You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By now I spend several days trying to figure out how to deploy a Python function to a consumption based plan using this action and I have come to the conclusion that this is not possible. However, there is no warning or any indication about this. Please add either a documentation how to do it or a warning that it is not possible.
Setup
Python is supported only on a Linux-based hosting plan when it's running in Azure.
In essence the problem boils down to the possible states of the WEBSITE_RUN_FROM_PACKAGE environment variable in the Azure Function.
Without WEBSITE_RUN_FROM_PACKAGE
A newly created Azure Function does not have the environment variable set. Therefore, the execution of the azure function fails.
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_26238559607[44](XXXX)894.zip as ZipDeploy content
Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Error: Deployment Failed!
Btw. there is no indication where to find the logs that the error message is referring to in case of the failure. The link to the xxx.scm.azurewebsites.net logs is only displayed in case of a successful deployment .
With WEBSITE_RUN_FROM_PACKAGE = 1
In this case the GitHub action runs through without an error. However, the deployed function is not visible in the Azure Portal. This is somewhat expected behaviour as the documentation clearly states that Linux Consumption based Functions need to set the value to a URL:
External package URL is the only supported deployment method for Azure Functions running on Linux in the Consumption plan Source Other source
With WEBSITE_RUN_FROM_PACKAGE =
The expected solution is to set the WEBSITE_RUN_FROM_PACKAGE to a URL that is created during the deployment of the function using this GitHub Action e.g. the value of the SCM_RUN_FROM_PACKAGE variable. However, in this scenario the GitHub Action also fails:
Error: Execution Exception (state: PublishContent) (step: Invocation)
Error: When request Azure resource at PublishContent, zipDepoy : WEBSITE_RUN_FROM_PACKAGE in your function app is set to an URL. Please remove WEBSITE_RUN_FROM_PACKAGE app setting from your function app.
Error: Deployment Failed!
The suggested fix to remove the variable does unfortunately not work as stated above.
With WEBSITE_RUN_FROM_PACKAGE = anything else
For the sake of completeness I also tried to run the action with something else than the official options. As expected, the function fails with:
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_5530634294070984.zip as ZipDeploy content
Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Error: Deployment Failed!
Conclusion
Given that none of the options results in a working Azure function I have to assume that it is just not possible to use this action for consumption based Linux functions. I would be more than happy if you could highlight my mistake.
The text was updated successfully, but these errors were encountered:
WEBSITE_RUN_FROM_PACKAGE = URL will only work with this action if you are using service principle and not publish profile. Also, it will not support remote build.
If you want remote build, then used publish profile and pass remote build parameters with this action. Also, remove WEBSITE_RUN_FROM_PACKAGE app setting from your app.
By now I spend several days trying to figure out how to deploy a Python function to a consumption based plan using this action and I have come to the conclusion that this is not possible. However, there is no warning or any indication about this. Please add either a documentation how to do it or a warning that it is not possible.
Setup
source
Function App
Action configuration
The action is exactly in line with the example. The slot-name has been added or removed but is irrelevant for the behaviour.
Repository structure
The repository contains a Hello world application using exactly the setup of the official documentation
Behaviour
In essence the problem boils down to the possible states of the
WEBSITE_RUN_FROM_PACKAGE
environment variable in the Azure Function.Without WEBSITE_RUN_FROM_PACKAGE
A newly created Azure Function does not have the environment variable set. Therefore, the execution of the azure function fails.
Btw. there is no indication where to find the logs that the error message is referring to in case of the failure. The link to the
xxx.scm.azurewebsites.net
logs is only displayed in case of a successful deployment .With WEBSITE_RUN_FROM_PACKAGE = 1
In this case the GitHub action runs through without an error. However, the deployed function is not visible in the Azure Portal. This is somewhat expected behaviour as the documentation clearly states that Linux Consumption based Functions need to set the value to a URL:
With WEBSITE_RUN_FROM_PACKAGE =
The expected solution is to set the
WEBSITE_RUN_FROM_PACKAGE
to a URL that is created during the deployment of the function using this GitHub Action e.g. the value of theSCM_RUN_FROM_PACKAGE
variable. However, in this scenario the GitHub Action also fails:The suggested fix to remove the variable does unfortunately not work as stated above.
With WEBSITE_RUN_FROM_PACKAGE = anything else
For the sake of completeness I also tried to run the action with something else than the official options. As expected, the function fails with:
Conclusion
Given that none of the options results in a working Azure function I have to assume that it is just not possible to use this action for consumption based Linux functions. I would be more than happy if you could highlight my mistake.
The text was updated successfully, but these errors were encountered: