Azure-Web-sites: How to cancel a deployment?

半腔热情 提交于 2021-02-11 07:56:12

问题


I have an Azure Function App / Azure Website setup with continuous deployment from source-control.

This App has a custom deployment script that takes quite a bit of time to run. Occasionally I push out a change to git which was a mistake, and I want to cancel that one deployment (While still allowing future git pushes to cause a deployment).

Is there a PowerShell command I can run, or some option which will cancel my current deployment?


回答1:


I was able to figure this out eventually, and figured I'd post it here. There is no "clean" way to do this, but there is a "hack".

  1. Navigate to your SCM site:

    [YOUR_WEBSITE].scm.azurewebsites.net

  2. Click on "Process Explorer"

  3. Find the process which is the current deployment and choose "Properties".

  4. Scroll to the bottom of the page and choose "Kill"

Voilà, you've killed your deployment in the middle.




回答2:


There's nothing simple as far as I know.

It's possible that deleting the deployment via kudu rest apis (https://github.com/projectkudu/kudu/wiki/REST-API#deployment) would achieve what you want, but I expect that that will fail during deployment / only delete metadata and logs about the deployment.

Also, cancelling a deployment could leave unwanted artifacts in the filesystem / corrupt your web app. It's probably best to modify your deployments so that you have a development branch and a release branch in order to set up a more robust CI scenario.



来源:https://stackoverflow.com/questions/41965933/azure-web-sites-how-to-cancel-a-deployment

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