5

Getting the following error while running an Azure DevOps pipeline that uses the Azure App Service Deploy task when the resource clearly exists. This is happening in an existing pipeline that historically works.

 ##[error]Error: Resource 'blah' doesn't exist. Resource should exist before deployment.
 (node:2432) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getApplicationURL' of undefined
     at WindowsWebAppWebDeployProvider.<anonymous> (D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\4.195.4\deploymentProvider\AzureRmWebAppDeploymentProvider.js:54:73)
     at Generator.next (<anonymous>)
     at D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\4.195.4\deploymentProvider\AzureRmWebAppDeploymentProvider.js:8:71
     at new Promise (<anonymous>)
     at __awaiter (D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\4.195.4\deploymentProvider\AzureRmWebAppDeploymentProvider.js:4:12)
     at WindowsWebAppWebDeployProvider.UpdateDeploymentStatus (D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\4.195.4\deploymentProvider\AzureRmWebAppDeploymentProvider.js:48:16)
     at D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\4.195.4\azurermwebappdeployment.js:38:42
     at Generator.throw (<anonymous>)
     at rejected (D:\a\_tasks\AzureRmWebAppDeployment_497d490f-eea7-4f2b-ab94-48d9c1acdcb1\4.195.4\azurermwebappdeployment.js:6:65)
     at process._tickCallback (internal/process/next_tick.js:68:7)
 (node:2432) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
 (node:2432) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

The following is the YAML for this task:

- task: AzureRmWebAppDeployment@4
  displayName: 'Deploy'
  inputs:
    azureSubscription: ${{ parameters.ConnectedServiceName }}
    WebAppName: 'blah'
    packageForLinux: '$(Pipeline.Workspace)/Blah'
    enableCustomDeployment: true
    TakeAppOfflineFlag: false
    SetParametersFile: '$(Pipeline.Workspace)/Blah/TokenParameters.xml'
    RemoveAdditionalFilesFlag: true
    enableXmlTransform: false
    enableXmlVariableSubstitution: false
    AdditionalArguments: '-skip:objectName=dirPath,absolutePath=Angular'
Evil August
  • 411
  • 6
  • 18
  • Hi Evil August; can you post your yaml for that task? It'd help pin down what might be going wrong. – Vince Bowdren Jan 10 '22 at 23:27
  • @VinceBowdren Thank you. I have updated with the YAML. – Evil August Jan 12 '22 at 19:23
  • Adding to Vince's comment. Just to clarify, when you say "This is happening in an existing pipeline that historically works.", were there any specific changes done? does it work locally fine? – AjayKumar Jan 12 '22 at 19:23
  • 1
    @AjayKumar-MSFT I have seen this come and go with no changes to the pipeline and even deploying the same code base. The only thing that has changed is time. – Evil August Jan 12 '22 at 19:25
  • 3
    I started having a similar issue today too, and came here while looking for tips. I have ~30 Azure Functions setup already that works as they should, but I have created 4 new ones today that gives the error described in the question. Only the functions created today are affected. And the weird part is that a couple of times today, they have actually worked, so the functions are up and running. I've been trying to re-deploy all day, and it seems to work 1 out of 10 times. Please let me know if I can help somehow. – mathkid91 Jan 12 '22 at 20:25
  • Thanks for additional details. Kindly review the service principal authentication permission as mentioned in the similar [discussion 1](https://stackoverflow.com/a/62965625/8194837) and If it’s self-hosted Windows agent to deploy Azure App Service via ARM template. Enable the agent to run behind a [web proxy](https://learn.microsoft.com/azure/devops/pipelines/agents/proxy?view=azure-devops&tabs=windows ), pass --proxyurl, --proxyusername and --proxypassword during agent configuration. Also, review the agent version. Kindly let us know will follow-up further. – AjayKumar Jan 13 '22 at 20:20
  • @AjayKumar-MSFT The following evening/night on my last comment, I moved my "bad projects" to the front of the release queue (to save some time), and then just triggered re-deploys until it worked. It took 2 and 4 attempts to get my two projects up with latest code of the day. The next day, and until now, I have not had the issue anymore. I don't know everything happening behind the scenes, but it kinda felt like one/some of the agents weren't able to find my newest resources at that time. – mathkid91 Jan 17 '22 at 14:10
  • 1
    mathkid91, apologies for the frustrating experience with this. Kindly check this [Azure status](https://status.azure.com/status/history/) - [Azure Resource Manager - Issues with management and resource operations] issue reported on 1/13. And, also this related [GitHub thread](https://github.com/microsoft/azure-pipelines-tasks/issues/15532). If the issue still persists, to perform a deeper investigation on this, I would need more information about your WebApp and sub details. (Since subscription details are PII, please let know me, I would follow-up on this with the next steps). – AjayKumar Jan 19 '22 at 14:25
  • @AjayKumar-MSFT Thank you for your assistance. I currently have an open support request. And yes, this is still an issue. – Evil August Jan 19 '22 at 17:25
  • Could you please share your support request with me on your Q&A [thread](https://learn.microsoft.com/en-us/answers/questions/689860/index.html) *privately*, I'll internally track and follow-up on this. – AjayKumar Jan 20 '22 at 17:26
  • @AjayKumar-MSFT I just messaged you on the other thread. Thank you. – Evil August Jan 20 '22 at 21:38
  • Thanks for your message on the Q&A thread. I have followed-up further. – AjayKumar Jan 26 '22 at 09:31

0 Answers0