exec in azure appservice for containers (windows)

76 Views Asked by At

I want to run a PowerShell script after container is up and running (not during startup) or even on demand in Azure App Service for containers. I couldn't find any commands or workarounds to achieve this. Can anyone please suggest any workarounds or standard methods to accomplish this?

my PowerShell is available in the image

i do can manually run it in ssh (Azure portal) but i want to automate this

couldnt find an working way

1

There are 1 best solutions below

3
On

You can achieve this with a remote connection to your App Service. The Azure CLI for example supports this feature:
https://learn.microsoft.com/en-us/azure/app-service/configure-linux-open-ssh-session?pivots=container-linux#open-ssh-session-from-remote-shell

But be carefull. The feature is in preview!

https://learn.microsoft.com/en-us/cli/azure/webapp?view=azure-cli-latest#az-webapp-create-remote-connection

And please be sure for security concerns that you disable remote debugging (needs to be enabled for the remote conncetion) after you did all your script work.