Azure / webapps-deploy

Enable GitHub developers to deploy to Azure WebApps using GitHub Actions
MIT License
260 stars 185 forks source link

Deployment Faile***, Error: Resource azwb********-tot doesn't exist. #399

Open ashh0710 opened 4 months ago

ashh0710 commented 4 months ago

While making deployment to the azure app service using Github Actions, getting the below mentioned error:

2024-02-12T13:32:39.8139749Z ##[*ebug][GET] https://management.azure.com/subscriptions/****-*313-4054-aa3-c0ca6bea983/resources?$filter=resourceType EQ 'Microsoft.Web%2FSites' AND name EQ 'azwblpau01-tot'&api-version=2016-07-01 2024-02-12T13:32:39.9341215Z ##[error]Deployment Faile, Error: Resource azwb*lpau01-tot * doesn't exist. 2024-02-12T13:32:38.0120486Z ##[group]Run azure/webapps-eploy@v2 2024-02-12T13:32:38.0121146Z with: 2024-02-12T13:32:38.0121632Z app-name: azwblpau01-tot 2024-02-12T13:32:38.0122693Z images: azacrlpau01.azurecr.io/backen-lpau:567079fe82336af7e917369b166a8e904e3 2024-02-12T13:32:38.0123838Z slot-name: pro*uction 2024-02-12T13:32:38.0124378Z package: . 2024-02-12T13:32:38.0124824Z env: 2024-02-12T13:32:38.0125290Z SUB_NAME_FORMAT: ** 2024-02-12T13:32:38.0125987Z RG_NAME_FORMAT: ** 2024-02-12T13:32:38.0126649Z WEBAPP_NAME_FORMAT: azwb{0}lpau01-tot 2024-02-12T13:32:38.0127330Z PYTHON_VERSION: 3.9 2024-02-12T13:32:38.0127907Z ACR_NAME: azacr*lpau01.azurecr.io 2024-02-12T13:32:38.0128563Z image-name: backen 2024-02-12T13:32:38.0129302Z pythonLocation: /opt/hostetoolcache/Python/3.9.18/x64 2024-02-12T13:32:38.0130331Z LD_LIBRARY_PATH: /opt/hostetoolcache/Python/3.9.18/x64/lib 2024-02-12T13:32:38.0131400Z DOCKER_CONFIG: /home/runner/work/_temp/ocker_login_1707744667772 2024-02-12T13:32:38.0132344Z ##[engroup] 2024-02-12T13:32:38.3308894Z ##[ebug]try-get AzureCLIAuthorizer 2024-02-12T13:32:38.3576858Z ##[ebug]"/usr/bin/az" account show 2024-02-12T13:32:38.8756737Z ##[ebug]"/usr/bin/az" clou show 2024-02-12T13:32:39.2663971Z ##[ebug]"/usr/bin/az" account get-access-token 2024-02-12T13:32:39.8111094Z ::a-mask:: 2024-02-12T13:32:39.8139749Z ##[ebug][GET] https://management.azure.com/subscriptions/546c4b1b-313-4054-aa3-c0ca6bea983/resources?$filter=resourceType EQ 'Microsoft.Web%2FSites' AND name EQ 'azwblpau01-tot'&api-version=2016-07-01 2024-02-12T13:32:39.9341215Z ##[error]Deployment Faile, Error: Resource azwblpau01-tot oesn't exist. 2024-02-12T13:32:39.9349819Z ##[ebug]Deployment faile 2024-02-12T13:32:39.9469110Z ##[ebug]Noe Action run complete with exit coe 1 2024-02-12T13:32:39.9474955Z ##[ebug]AZURE_HTTP_USER_AGENT='GITHUBACTIONS_DeployWebAppToAzure_2bfbf8bf5ff9cf57423557818eb3f2805cae5457a22f28b192c76f59b5' 2024-02-12T13:32:39.9477117Z ##[ebug]AZURE_HTTP_USER_AGENT='' 2024-02-12T13:32:39.9485324Z ##[***ebug]Finishing: Deploy Container Image to Azure App Service

The resource does exist and deployments could be made using azure cli. But with Github actions the deployment fails with Resource does not exist error.

Please assist with the issue.

jon-stellar commented 3 months ago

I'm having the same issue -- it fails after the step to query for the app by name. This file is fully created by Azure's portal when setting up the integration, so I would expect it to work. But it fails just like this.

I setup a similar thing 5 months ago and that deploy still runs without issue, but I noticed the task is using different publishing certificates, so maybe something changed in the workflow file created in the last 5 months and now there is a bug?

jaandrews commented 3 months ago

I'm running into this issue as well. Have been trying to switch from the azure app service build service to github actions for a web app that was created a couple years ago, but it fails to find the resource. Logs are as follows, though it's a bit different from ashh0710's example, likely due to web app differences (potentially sensitive bits have been replaced with "xxx").

[debug]Evaluating condition for step: 'Deploy to Azure Web App'

[debug]Evaluating: success()

[debug]Evaluating success:

[debug]=> true

[debug]Result: true

[debug]Starting: Deploy to Azure Web App

[debug]Loading inputs

[debug]Loading env

Run azure/webapps-deploy@v2

[debug]try-get AzureCLIAuthorizer

[debug]"C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" account show

[debug]"C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" cloud show

[debug]"C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" account get-access-token

::add-mask::***

[debug][GET] https://management.azure.com/subscriptions/***/resources?$filter=resourceType EQ 'Microsoft.Web%2FSites' AND name EQ 'xxx'&api-version=2016-07-01

Error: Deployment Failed, Error: Resource xxx doesn't exist.

[debug]Deployment failed

[debug]Node Action run completed with exit code 1

[debug]AZURE_HTTP_USER_AGENT='GITHUBACTIONS_DeployWebAppToAzure_xxx'

[debug]AZURE_HTTP_USER_AGENT=''

[debug]Finishing: Deploy to Azure Web App

I also tried using "azure/webapps-deploy@v3," but it runs into the same error.

jon-stellar commented 3 months ago

FYI I was able to get past this issue by re-creating the Azure-to-Github connection but selecting "Basic Authentication" in the setup screen within Azure (had previously used "User-assigned Identity") image

So, for me at least, it seemed to have something to do with the way it was authenticating from github back to azure.

jaandrews commented 3 months ago

That could be a workaround for my issue, as I was using "User-assigned identity." Ended up deploying with the app services build service instead, so I don't plan to test this soon, but will give it a whirl the next time I set up a deployment.

zx2a17 commented 3 weeks ago

same here, it just says resource doesn't exist but I thought this is to deployed the said resource...