Azure / functions-action

Enable GitHub developers to deploy to Azure Function Apps using GitHub Actions
MIT License
152 stars 75 forks source link

GH Action suddenly started to fail, was working fine for 2+ years #204

Open sinedied opened 11 months ago

sinedied commented 11 months ago

I have a deployment working that stopped working suddenly, and I'm not sure why: https://github.com/sinedied/azure-checkin/actions/runs/6453368420/job/17516822541

trace:

Run Azure/functions-action@v1.5.1
Successfully parsed SCM credential from publish-profile format.
Using SCM credential for authentication, GitHub Action will not perform resource validation.
(node:2530) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: Execution Exception (state: ValidateAzureResource) (step: Invocation)
Error:   When request Azure resource at ValidateAzureResource, Get Function App Settings : Failed to acquire app settings from https://<scmsite>/api/settings with publish-profile
Error:     Failed to fetch Kudu App Settings.
Unauthorized (CODE: 401)
Error:       Error: Failed to fetch Kudu App Settings.
Unauthorized (CODE: 401)
    at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1.5.1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:69:[23](https://github.com/sinedied/azure-checkin/actions/runs/6453368420/job/17516822541#step:7:24))
    at Generator.next (<anonymous>)
    at fulfilled (/home/runner/work/_actions/Azure/functions-action/v1.5.1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:5:58)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
Error: Deployment Failed!

I've tried updating the action and the publish profile, same error.

Nothing have changed from the Azure side, and manual deployments using the func cli still works fine.

zack4485 commented 10 months ago

I'm guessing your problem is this: https://learn.microsoft.com/en-us/azure/app-service/deploy-configure-credentials?tabs=cli#webdeploy-and-scm

Does it work if you run the following command?

az resource update --resource-group <resource-group> --name scm --namespace Microsoft.Web --resource-type basicPublishingCredentialsPolicies --parent sites/<site-name> --set properties.allow=false

If so probably what caused your deployment to "randomly" break is a change to your company's security policy...

github-actions[bot] commented 10 months ago

This issue is idle because it has been open for 14 days with no activity.

patelchandni commented 10 months ago

@sinedied As mentioned above, if your company's security policy is restricting use of publish profile, then you if have to use RBAC credentials to configure your GitHub workflow: https://github.com/Azure/functions-action#using-azure-service-principal-for-rbac-as-deployment-credential

github-actions[bot] commented 9 months ago

This issue is idle because it has been open for 14 days with no activity.

mboiman commented 7 months ago

I experience a similar issue, occurring about three times a week. If I allow a wait time of 8-12 hours, it typically resolves by the next day. While waiting is a solution, my schedule doesn't afford me the luxury of that much downtime.

App setting ENABLE_ORYX_BUILD propagated to Kudu container Package deployment using ZIP Deploy initiated. Error: Failed to deploy web package to App Service. Error: Execution Exception (state: PublishContent) (step: Invocation) Error: When request Azure resource at PublishContent, zipDeploy : Failed to use /home/runner/work/_temp/temp_web_package_10742594107666159.zip as ZipDeploy content Error: Failed to deploy web package to App Service. Not Found (CODE: 404) Error: Error: Failed to deploy web package to App Service. Not Found (CODE: 404) at Kudu.<anonymous> (/home/runner/work/_actions/Azure/functions-action/v1.5.1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:235:41) at Generator.throw (<anonymous>) at rejected (/home/runner/work/_actions/Azure/functions-action/v1.5.1/lib/appservice-rest/Kudu/azure-app-kudu-service.js:6:65) at processTicksAndRejections (node:internal/process/task_queues:96:5) Error: Deployment Failed!

github-actions[bot] commented 7 months ago

This issue is idle because it has been open for 14 days with no activity.

daniloak commented 4 months ago

@patelchandni I have the same problem and it's just myself building using a free subscription, I didn't restrict anything, I am using everything as it is

Error: Execution Exception (state: ValidateAzureResource) (step: Invocation)
Error:   When request Azure resource at ValidateAzureResource, Get Function App Settings : Failed to acquire app settings from https://<scmsite>/api/settings with publish-profile
Error:     Failed to fetch Kudu App Settings.
Unauthorized (CODE: 401)
Error:       Error: Failed to fetch Kudu App Settings.
Unauthorized (CODE: 401)
daniloak commented 4 months ago

I finally configured the function in the deployment center, it created a managed identity with the permissions. I believe this is what this is doing Rbac