Is it possible to convert the publish method of an App Service from Code to Docker?

六眼飞鱼酱① 提交于 2020-12-07 20:06:16

问题


I have set up an Azure App Service (Linux) publish method being Code and have set up the appropriate pipeline to build and deploy my code (nodejs). Now I need more control on the host running my code (need poppler). On dev + test I have created new App Services and have chosen Docker Container as publish method

My question: for my PROD instance, is it possible to change the publish method of my existing App Service or do I have to create a new App Service ?

Assuming the latter, I would need to update the client to point to the new App Service URL. To avoid that, could I first delete the existing App Service and create a new one with the same name ? This would make me lose all stats and logs.

Any alternative suggestions?


回答1:


the App Service Plan can run either code or container

https://docs.microsoft.com/en-us/cli/azure/appservice/plan?view=azure-cli-latest#az-appservice-plan-create

The Web App that target the App Service Plan can come from a custom docker OR a known source code base. (e.g. nodejs)

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

when selecting code, you are setting the runtimes and allowing the web app to fetch the code, what happens is the the runtime will used a well known base container and bring in your code.

In the end, you shouldn't have a problem deploying a container based web app on the same App Service Plan even though the original deployment was using Code Base.

you should rely on the Azure CLI more since the portal sometimes doesn't provide you with the full power.

Also hav a look at the App Service Swapping method, to move your traffic from your code base to your container base.

https://docs.microsoft.com/en-us/azure/app-service/deploy-staging-slots

you can leverage slots to help you out with the swapping!



来源:https://stackoverflow.com/questions/62924348/is-it-possible-to-convert-the-publish-method-of-an-app-service-from-code-to-dock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!