microsoft / vscode-docker

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

"Deploy Image to Azure App Service" only creates New Web App #1535

Closed ucheNkadiCode closed 3 weeks ago

ucheNkadiCode commented 4 years ago

From within Docker Extension in Visual Studio Code:

Steps to reproduce:

  1. Build an image and tag it with correct path for Azure Container Registry (someusername.azurecr.io/someexpressapp:latest)
  2. Push the latest image to the Azure Container Registry
  3. From "Registries" pane in Docker Extension, Find the specific image that was pushed and select "Deploy Image to Azure App Service" - (This is assuming it is your first time deploying to an App Service)
  4. Go through flow of selecting resource group and Creating/Selecting service plan.
  5. After this app is successfully deployed, make changes to the Application, such as adding files or changing a Dockerfile setting.
  6. Rebuild and Repush image
  7. Go to the same image in "Registries" pane again and select "Deploy Image to Azure App"

From here you will see that although this app has already been deployed, it is assumed this command is only used for creating an entirely new web app. This is not desired behavior. As a user, I would expect an option to deploy to an existing web app (Created in step 4) or to create a new web app. Otherwise the only way to redeploy the image is to go to the Azure App Service Extension and hit refresh according to this guide for Python Devs

philliphoff commented 4 years ago

Otherwise the only way to redeploy the image is to go to the Azure App Service Extension and hit refresh according to this guide for Python Devs

To be clear, the "Deploy Image to Azure App" command, in addition to creating a new app service, also sets up an ACR web hook so that pushes to the same repository/tag will cause a redeployment to that app service. (@ucheNkadiCode It would be great if you could verify that. We likely need to ensure that the referenced guide is updated with that fact.)

That said, it seems like it could be useful for the user to push to existing app services, in cases where that web hook is not (or no longer) in place (such as when the user's hit their maximum number of web hooks for their Azure tier of usage). We may then also want to warn the user if they choose to deploy an altogether different image (rather than just a new version of a given tag) to that app service.

ucheNkadiCode commented 4 years ago

...in cases where that web hook is not (or no longer) in place (such as when the user's hit their maximum number of web hooks for their Azure tier of usage).

Or regardless of if a Web Hook may or may not be set, a developer would now get a "Manual Refresh" feedback loop wherein the user does a Build -> Push to registry of choice -> Deploy to existing Azure App. From your description, I recognize what "Deploy Image to Azure App" does, but unless we make plans to also allow users to hit the equivalent of "Manual Refresh" for their Azure App, wording could be changed to "Create New App Web App from Image" to be more clear

dbreshears commented 3 weeks ago

Closing stale issue as it is not planned