admin管理员组文章数量:1321244
Azure function zip deployment not working with
var appServicePlanData = new AppServicePlanData(region)
{
Sku = new AppServiceSkuDescription
{
Name = "Y1",
Tier = "Consumption",
Size = "Y1"
},
Kind = "functionapp",
};
when WebsiteRunFromPackage is set to 0. but working fine when WebsiteRunFromPackage is set to 1.
I am using zip deplyment approach. Here is the url for that.
string zipDeployUrl = $"https://{functionAppName}.scm.azurewebsites/api/zipdeploy";
I alredy tried by setting WebsiteRunFromPackage value to 1 and it is working fine with that. Need to know how to make it work with 0 because I don't want my wwwroot folder to be readonly.
Azure function zip deployment not working with
var appServicePlanData = new AppServicePlanData(region)
{
Sku = new AppServiceSkuDescription
{
Name = "Y1",
Tier = "Consumption",
Size = "Y1"
},
Kind = "functionapp",
};
when WebsiteRunFromPackage is set to 0. but working fine when WebsiteRunFromPackage is set to 1.
I am using zip deplyment approach. Here is the url for that.
string zipDeployUrl = $"https://{functionAppName}.scm.azurewebsites/api/zipdeploy";
I alredy tried by setting WebsiteRunFromPackage value to 1 and it is working fine with that. Need to know how to make it work with 0 because I don't want my wwwroot folder to be readonly.
Share Improve this question asked Jan 17 at 15:18 AmitAmit 779 bronze badges1 Answer
Reset to default 0When you use zip deploy, the code will run directly in zip (that is mounted to wwwroot folder thus read only). More technical details here
https://learn.microsoft/en-us/azure/azure-functions/run-functions-from-deployment-package
If you don't want to use zip deploy, you need to deploy all code into wwwroot using normal deploy method. By just set WebsiteRunFromPackage to 0 won't work as there is code in wwwroot folder yet.
Deploy using .ZIP package for Linux Consumption
ZipDeploy extension with the appSetting WEBSITE_RUN_FROM_PACKAGE=1 is not supported only for Linux Consumption plan
. For Linux Consumption plan: Do not use ZipDeploy extension
. Set appSetting WEBSITE_RUN_FROM_PACKAGE=URL for deployment using the .zip package url.
https://github/Azure-Samples/function-app-arm-templates/tree/main/function-app-linux-consumption
Steps to deploy for linux Consumption plan
:
- create a private-access container in the Blob storage
- zip the application files
- upload the ZIP archive to the container
- ask Azure for the URL to the archive
- ask Azure to give you a read-only shared access signature (SAS) to the archive
- construct the full URL
- add a configuration to the function app to run from the zip archive we just uploaded
refer to this great post: https://tomaskohl/code/2022/automated-deployment-linux-azure-functions-app/
The vs code
azure extension is able to deploy to Y1 plan correctly, see below screenshot.
本文标签:
版权声明:本文标题:Azure function zip deployment not working with consumption plan and WebsiteRunFromPackage is set to 0 - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742096434a2420577.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论