Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux Consumption Function app sync trigger fails with RBAC auth when WEBSITE_RUN_FROM_PACKAGE is already added with new URL #147

Open
akbast opened this issue Aug 15, 2022 · 30 comments

Comments

@akbast
Copy link

akbast commented Aug 15, 2022

Hello,

When we try to deploy our node function we are getting following error:

Run Azure/functions-action@v1.4.6
Using RBAC for authentication, GitHub Action will perform resource validation.
Successfully acquired site configs from function app!
Detected function app sku: Consumption
Successfully acquired app settings from function app (RBAC)!
Detected function app language: Node
Will archive . into /home/runner/work/_temp/temp_web_package_***.zip as function app content
Will use WEBSITE_RUN_FROM_PACKAGE to deploy since RBAC is detected and your function app is on Linux Consumption.
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error:   When request Azure resource at PublishContent, Sync Trigger Functionapp : Failed to perform sync trigger on function app. Function app may have malformed content. Please manually restart your function app and inspect the package from WEBSITE_RUN_FROM_PACKAGE.
Error: Deployment Failed!

When I check the WEBSITE_RUN_FROM_PACKAGE Parameter in Azure Portal, I see that the parameter is updated. Removing WEBSITE_RUN_FROM_PACKAGE from function and redeploying works.

Technical details:

  • node function
  • linux
  • RBAC Deployment
  • consumption plan

Any Idea, what could be wrong?

Cheers

@patelchandni
Copy link
Collaborator

A fix for this issue is added in this PR: #148
@akbast Please test and let us know if the problem still exists.

@akbast
Copy link
Author

akbast commented Aug 17, 2022

I have tested with the latest version v1.4.7 of the action and the problem still exists.

@adukstad
Copy link

adukstad commented Aug 23, 2022

Same for us.

Technical details:

  • .net 6
  • linux
  • RBAC Deployment
  • consumption plan

tested with both v1.4.6 and v1.4.7

@github-actions
Copy link

github-actions bot commented Sep 6, 2022

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

@github-actions github-actions bot added the idle label Sep 6, 2022
@Cuahchic
Copy link

Cuahchic commented Sep 6, 2022

We are also suffering with this issue on the latest version of this action.

@github-actions github-actions bot removed the idle label Sep 6, 2022
@dkuwcreator
Copy link

Me too, with same technical details

@patelchandni patelchandni changed the title Function not deploying when WEBSITE_RUN_FROM_PACKAGE exists already Linux Consumption Function not deploying when WEBSITE_RUN_FROM_PACKAGE exists already Sep 13, 2022
@patelchandni patelchandni changed the title Linux Consumption Function not deploying when WEBSITE_RUN_FROM_PACKAGE exists already Linux Consumption Function app sync trigger fails with RBAC auth when WEBSITE_RUN_FROM_PACKAGE is already added with new URL Sep 13, 2022
@patelchandni
Copy link
Collaborator

@Cuahchic
Copy link

Please try to deploy using publish profile instead of RBAC like here: https://github.com/Azure/actions-workflow-samples/blob/a9e4bce81a6c87e56021a480805a521403437eaf/FunctionApp/linux-python-functionapp-on-azure.yml#L46

According to my previous attempts using publish profiles, they are not compatible with WEBSITE_RUN_FROM_PACKAGE values being set, and these are necessary for package deployments. They must be set to a URL for a Linux consumption plan project according to this documentation: https://docs.microsoft.com/en-us/azure/azure-functions/run-functions-from-deployment-package#enable-functions-to-run-from-a-package

@patelchandni
Copy link
Collaborator

Go to azure portal and remove function app setting "WEBSITE_RUN_FROM_PACKAGE". Once it is successful, then re-deploy using publish profile instead of RBAC like here: https://github.com/Azure/actions-workflow-samples/blob/a9e4bce81a6c87e56021a480805a521403437eaf/FunctionApp/linux-python-functionapp-on-azure.yml#L46

WEBSITE_RUN_FROM_PACKAGE = 1 is not supported on Linux consumption because of which the other option is WEBSITE_RUN_FROM_PACKAGE = URL if the user wants to use a remote zip.

Using ZipDeploy path is the recommended path for Linux Consumption, and it doesn't increase cold start.

@patelchandni
Copy link
Collaborator

@akbast please try the above steps and let me know if it works.

@akbast
Copy link
Author

akbast commented Sep 20, 2022

@patelchandni it works with publish profile, as you described. The problem is, I have bunch of functions in a subscription which should be deployed with GitHub Actions. For achieving this, I have created a SP to use RBAC deployment.

If you have only one function app, this could be a workaround. But for multiple function apps, the RBAC deployment will be definitely necessary.

@adukstad
Copy link

Can confirm that it works with publish-profile, but as @akbast mentions: this does not scale well with multiple func-apps.

Will Functionapps on linux consumption plans + RBAC deployment be supported in the future?

@github-actions
Copy link

github-actions bot commented Oct 7, 2022

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

@Choonster
Copy link

Using a publish profile with Zip Deploy has the issue of not preserving Linux file permissions, as described here.

@github-actions github-actions bot removed the idle label Jan 14, 2023
@github-actions
Copy link

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

@github-actions github-actions bot added the idle label Jan 28, 2023
@kc9zyz
Copy link

kc9zyz commented Apr 4, 2023

Hello, I am experiencing the same issue as described above. I have no issues running a function app using the publish profile, but it will not publish when using RBAC -which would be very helpful to have as we have a number of functions and environments. Looking at the azure functions activity log, I can see a number of "BadRequest" errors during the publish process.

@github-actions github-actions bot removed the idle label Apr 4, 2023
@danbasszeti
Copy link

Experiencing the same problem currently @patelchandni

@github-actions
Copy link

github-actions bot commented May 1, 2023

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

@github-actions github-actions bot added the idle label May 1, 2023
@akbast
Copy link
Author

akbast commented May 9, 2023

Hello @patelchandni,

I have in between some news about this. We have tested following:

I created a Function in West Europe and tried to deploy the Function via GitHub Actions with GitHub hosted runners. It did not work. The Action is asking https://management.azure.com/subscriptions/***/resources?$filter=resourceType endpoint to check if the resource is existing. And it gets a response back, which is empty and the action keeps failing. I do not know, where the normal GitHub Runners are located, possibly in USA and therefore this endpoint is delivering an empty response.

Then I have tested this with a self-hosted runner, which is also in West Europe and it worked. But this cannot be a workaround, because it does not scale at all.

Conclusion: The management.azure.com Endpoint delivers information differently depends on from which region the request is coming and the “information” replication is not done yet, so that a request from a different region than the Function App is located delivers an empty response.

Hope it helps for your further investigation.

@github-actions github-actions bot removed the idle label May 9, 2023
@github-actions
Copy link

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

@github-actions github-actions bot added the idle label May 23, 2023
@EysteinWaade
Copy link

Been experiencing this consistently for 6 months. I can run the same deployment 2 times, with this error the first time, and a successful deployment on the retry.

@github-actions github-actions bot removed the idle label Jun 19, 2023
@github-actions
Copy link

github-actions bot commented Jul 3, 2023

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

@github-actions github-actions bot added the idle label Jul 3, 2023
@piyushsachdeva
Copy link

Facing the issue a well, I was wondering if anyone was able to resolve this?

@bytewisemarissa
Copy link

Facing this issue still in 2024

@BrunoJuchli
Copy link

@patelchandni
You've added the waiting-for-customer label. What information are you waiting for? From what I your questions have been answered? If not, we'd be willing to experiment/provide answers.

@beniclouds
Copy link

beniclouds commented Jun 6, 2024

facing the same issue using:
azurerm_linux_function_app
python - model v2
runtime ~4
using RBAC

@murshidameenpv
Copy link

Same issue here i cant see the function ans its details in Azue portal
Node 20
V4
Blob event trigger function
Resource
/subscriptions/fdb003bb-93c7-887d8dd8ad1d/resourceGroups//providers/Microsoft.Web/sites/blob-trigger-function-app/host/default
Operation name
Sync Web Apps Function Triggers
Time stamp
Mon Aug 05 2024 01:59:10 GMT+0530 (India Standard Time)
Event initiated by

Error code
Unauthorized
Message
Encountered an error (Forbidden) from extensions API.

@MichaMican
Copy link

MichaMican commented Oct 2, 2024

Same issue with .NET 8.
github action trhows the exact same error as OP
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error: When request Azure resource at PublishContent, Sync Trigger Functionapp : Failed to perform sync trigger on function app. Function app may have malformed content. Please manually restart your function app and inspect the package from WEBSITE_RUN_FROM_PACKAGE.
Error: Deployment Failed!

when restarting the function afew times and retrying a few time randomly it starts working again - please fix

Is there a way to remove tha labels from this issue? I think no one pays attention to it because its labled as "idle waiting for customer" - Maybe it makes sence to open a new issue?

@calebeom94
Copy link

calebeom94 commented Oct 2, 2024

Same issue for here with .NET 8 trying to redeploy through Github Action.

When request Azure resource at PublishContent, Sync Trigger Functionapp : Failed to perform sync trigger on function app. Function app may have malformed content. Please manually restart your function app and inspect the package from WEBSITE_RUN_FROM_PACKAGE.

Consumption Plan
.NET 8.0
Linux
RBAC Deployment

please find fix for this.

@piyushsachdeva
Copy link

I was able to deploy using ZipDeploy within Azure DevOps pipeline, here's the pipeline code
https://github.com/piyushsachdeva/AzureDevOps-Zero-to-Hero/tree/main/Day13#azure-devops-pipeline-code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests