microsoft / vscode-docker

Docker Extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-docker
Other
1.21k stars 515 forks source link

Fail to open the web page after deploying image (Windows Container) to Azure App Service #4130

Closed v-ruizh closed 11 months ago

v-ruizh commented 11 months ago

OS: Win 10 Build Version: 20231019.1 Regression: Not a Regression

Repro Steps:

  1. Switch Docker Desktop to "Windows Container".
  2. Open a .NET MVC project in VS Code Insiders.
  3. Add Docker related files to it.
  4. Build image for Dockerfile.
  5. Push the above image to ACR.
  6. Right click the image in registry view -> Deploy Image to Azure App Service -> Create a new app service.
  7. When done, click "Open Site" button in the notification.
  8. Check whether the web page can be opened successfully.

Expect: Succeed to open the web page. image

Actual: Fail to open the web page with "Application Error". image

More Info: This issue does not reproduce on "Linux Container".

bwateratmsft commented 11 months ago

Windows containers are a supported configuration for App Service so this might be worth a look.

bwateratmsft commented 11 months ago

I am able to reproduce.

bwateratmsft commented 11 months ago

It looks like we've never supported deploying Windows containers to App Service. I see a couple places in the deployment code that hardcode Linux: https://github.com/microsoft/vscode-docker/blob/e882270bd9a1ec7515d039bf4dc31239b7ec34ae/src/commands/registries/azure/deployImageToAzure.ts#L42 https://github.com/microsoft/vscode-docker/blob/e882270bd9a1ec7515d039bf4dc31239b7ec34ae/src/commands/registries/azure/DockerSiteCreateStep.ts#L116-L121

Pushing a Windows image to ACR is supported and does work, but deployment to App Service through the extension fails. You have to use portal to deploy the Windows image.