vscode-azureappservice icon indicating copy to clipboard operation
vscode-azureappservice copied to clipboard

Method to cancel deployments

Open hernanvoto opened this issue 5 years ago • 12 comments
trafficstars

Does this occur consistently? Repro steps:

  1. From Visual Studio Code, using the latest Azure extension as of June 2020
  2. Deploy an app to Azure App Services.

The deployment takes forever and there is no option to stop it.

Action: appService.Deploy Error type: 409 Error Message: There is a deployment currently in progress. Please try again when it completes.

Version: 0.17.0 OS: win32 OS Release: 10.0.18363 Product: Visual Studio Code Product Version: 1.45.1 Language: en

Call Stack
extension.bundle.js:309:399343extension.bundle.js:309:399343
retryCallback extension.bundle.js:225:116429
retryCallback extension.bundle.js:157:31051
extension.bundle.js:157:32664extension.bundle.js:157:32664
handleRedirect extension.bundle.js:171:7747
extension.bundle.js:157:29836extension.bundle.js:157:29836
Request._callback extension.bundle.js:1:584775
Request.r._callback.r.callback.r.callback extension.bundle.js:201:4468
Request.emit events.js:203:13
Request.<anonymous> extension.bundle.js:201:17577
Request.emit events.js:208:15
IncomingMessage.<anonymous> extension.bundle.js:201:16367
Object.onceWrapper events.js:291:20
IncomingMessage.emit events.js:208:15
endReadableNT _stream_readable.js:1168:12
processTicksAndRejections task_queues.js:77:11

hernanvoto avatar Jun 10 '20 04:06 hernanvoto

According to the API, there is a cancel deployment endpoint: https://docs.microsoft.com/en-us/rest/api/resources/deployments/cancel

Maybe we can do something to let users cancel an on-going deployment (especially if we see this error message)

nturinski avatar Jun 11 '20 18:06 nturinski

Ok interesting. Ideally, an option inside VCS would be great, in a context menu.

I have a more relevant and severe error. Can you help with an error deploying angular app in azure ?

On Fri, 12 Jun 2020 at 04:48, Nathan [email protected] wrote:

According to the API, there is a cancel deployment endpoint: https://docs.microsoft.com/en-us/rest/api/resources/deployments/cancel

Maybe we can do something to let users cancel an on-going deployment (especially if we see this error message)

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-azureappservice/issues/1589#issuecomment-642865321, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3JQPZM4GL34U6D54DB5KTRWERGJANCNFSM4N2AJR2Q .

-- Rob Voto Project Manager, Scrum Master, Business Analyst 0491 982 547

hernanvoto avatar Jun 11 '20 21:06 hernanvoto

Deploying an Angular app to Azure Web Apps is a little bit more complicated than hitting the deploy button, unfortunately. Specifically you have to set up virtual routes.

You can follow this guide here: https://levelup.gitconnected.com/deploy-angular-application-on-azure-web-service-960e441bb13d

But I recommend checking out Azure Static Web Apps Extension This was built to deploy SPAs, so it should be a lot easier to configure and get running!

nturinski avatar Jun 12 '20 00:06 nturinski

@nturinski I think the API you linked to is for deploying an ARM template, not for deploying to a web app

ejizba avatar Jun 12 '20 22:06 ejizba

@EricJizbaMSFT Nuts, you're right 🐿

nturinski avatar Jun 12 '20 23:06 nturinski

Guys, I do appreciate your time. I already set up an Angular hello world app without setting up virtual directories. I am using a Node Js configuration, with code (no docker) selected on a linux system. I am finding the management of this Angular app from VCS very complicated. the deployments may be immediate or take forever (hang) Most of the time I end up DELETING the whole configuration in Azure and starting again to make it work. It often happens that I deploy and then nothing changes (no code replacement) so again I have to delete and rebuild.

I need to try the proposed solution yet : https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel

What is the deployment name? The name of the project I set up in Azure? Since when I deploy I don't set any name from VSC.

I am trying to give @azure/ng-deploy - npm but this also fails, issue #55 in your bug list. Solution on #55 doesn't work for me so I am basically stuck with this Azure trial.

Summing up:

Main goal is to manage an Angular (on NodeJs) app via VCS deployed in Azure App Services.

On Sat, 13 Jun 2020 at 09:06, Nathan [email protected] wrote:

@EricJizbaMSFT https://github.com/EricJizbaMSFT Nuts, you're right 🐿

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/microsoft/vscode-azureappservice/issues/1589#issuecomment-643516128, or unsubscribe https://github.com/notifications/unsubscribe-auth/AH3JQP7WAUCVUU77IKZ65JLRWKYJDANCNFSM4N2AJR2Q .

-- Rob Voto Project Manager, Scrum Master, Business Analyst 0491 982 547

hernanvoto avatar Jun 15 '20 23:06 hernanvoto

@hernanvoto Unfortunately I think the cancel API is for ARM templates, and not web app deployments.

Yeah, unfortunately Azure Web Apps wasn't really built to handle Angular apps that well. I recommend checking out Azure Static Web Apps Extension This was built to deploy SPAs, so it should be a lot easier to configure. It uses GitHub, so any change you commit to your repo will go live to your app as well.

nturinski avatar Jun 16 '20 17:06 nturinski

any news on this issue?

zargaryanlilit avatar Aug 05 '21 14:08 zargaryanlilit

Looking at the Kudu documentation, I don't see an API call that can cancel the zip deployment yet: https://github.com/projectkudu/kudu/wiki/REST-API#zip. I spent some time looking at the documentation and didn't see anything. I posted an issue on their repo so we can continue to track that here: https://github.com/projectkudu/kudu/issues/3320

nturinski avatar Aug 06 '21 18:08 nturinski

Was this ever solved? I have a deployment that is permanently hung and can't even cancel through the portal. Is the only solution really to DELETE the app service and start from scratch?

chartsNgraphs avatar Jun 17 '22 16:06 chartsNgraphs

Sorry, but there isn't anything that the extension team can do about this. The endpoint to cancel a deployment doesn't currently exist, so we can't make a request to cancel it.

If you could upvote this issue, maybe we can make some traction https://github.com/projectkudu/kudu/issues/3320

nturinski avatar Jun 30 '22 19:06 nturinski

Hello, I'm a complete newb at Azure and trying to deploy a node app coming from Heroku. I'm just +1 this issue and the aforementioned 3320 issue to get the API route.

EliasTouil avatar Jul 22 '22 20:07 EliasTouil