英文:
How to suppress warning "ZipDeploy Validation WARNING: It is recommended to set app setting WEBSITE_RUN_FROM_PACKAGE = 1"
问题
在我的Azure DevOps管道中,我正在在Azure上部署一个逻辑应用,但是我收到了这个警告:
##[warning]"ZipDeploy 验证警告:建议设置应用程序设置 WEBSITE_RUN_FROM_PACKAGE = 1,除非你正在针对以下情况之一:
- 使用门户编辑。
- 运行部署后脚本。
- 需要在 wwwroot 中具有写入权限。
- 使用具有特殊要求的自定义处理程序。
注意:如果你决定更新应用程序设置 WEBSITE_RUN_FROM_PACKAGE = 1,你将需要重新部署你的代码。"
是否可以抑制此警告?
英文:
In my Azure DevOps pipeline, I'm deploying a logic app on Azure but I get this warning:
##[warning]"ZipDeploy Validation WARNING: It is recommended to set app setting WEBSITE_RUN_FROM_PACKAGE = 1 unless you are targeting one of the following scenarios:
1. Using portal editing.
2. Running post deployment scripts.
3. Need write permission in wwwroot.
4. Using custom handler with special requirements.
NOTE: If you decide to update app setting WEBSITE_RUN_FROM_PACKAGE = 1, you will have to re-deploy your code."
Is it possible to suppress this warning?
答案1
得分: 1
请确保将应用程序设置添加到允许 zip 部署,如下所示:
- task: AzureCLI@2
inputs:
# TODO: 用你的 Azure 服务连接的名称填充
azureSubscription: ''
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az functionapp config appsettings set --name $(LAname) --resource-group $(resourceGroupName) --settings "BLOB_CONNECTION_RUNTIMEURL=$(blobendpointurl)"
az functionapp config appsettings set --name $(LAname) --resource-group $(resourceGroupName) --settings "WORKFLOWS_RESOURCE_GROUP_NAME=$(resourceGroupName)"
az functionapp config appsettings set --name $(LAname) --resource-group $(resourceGroupName) --settings WEBSITE_RUN_FROM_PACKAGE=1
addSpnToEnvironment: true
useGlobalConfig: true
使用应用服务计划的 Powershell 任务:
- task: AzurePowerShell@5
inputs:
azureSubscription: 'MyAzureSubscription'
ScriptType: 'InlineScript'
Inline: |
Set-AzWebApp -Name MyWebApp -ResourceGroupName MyResourceGroup -AppSettings @{'WEBSITE_RUN_FROM_PACKAGE'='1';}
azurePowerShellVersion: 'LatestVersion'
确保在你的 YAML 流水线中更改部署方法为 deploymentMethod: 'runFromPackage'
,而不是 zipDeploy
,如下所示:
更改为:
然后运行你的流水线以允许 Azure Logic App 的 zip 部署。
参考链接:
AzureFunctionApp@1 给出有关删除自身的警告的问题 · Issue #17580 · microsoft/azure-pipelines-tasks · GitHub
英文:
Make sure to add the application settings to allow zip deploy like below:-
- task: AzureCLI@2
inputs:
# TODO: Fill in with the name of your Azure service connection
azureSubscription: ''
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: |
az functionapp config appsettings set --name $(LAname) --resource-group $(resourceGroupName) --settings "BLOB_CONNECTION_RUNTIMEURL=$(blobendpointurl)"
az functionapp config appsettings set --name $(LAname) --resource-group $(resourceGroupName) --settings "WORKFLOWS_RESOURCE_GROUP_NAME=$(resourceGroupName)"
az functionapp config appsettings set --name $(LAname) --resource-group $(resourceGroupName) --settings WEBSITE_RUN_FROM_PACKAGE=1
addSpnToEnvironment: true
useGlobalConfig: true
Powershell task with app service plan
- task: AzurePowerShell@5
inputs:
azureSubscription: 'MyAzureSubscription'
ScriptType: 'InlineScript'
Inline: |
Set-AzWebApp -Name MyWebApp -ResourceGroupName MyResourceGroup -AppSettings @{'WEBSITE_RUN_FROM_PACKAGE'='1'}
azurePowerShellVersion: 'LatestVersion'
Make sure you change the deployment-method in your YAML pipeline to deploymentMethod: ‘runFromPackage’ instead of ‘zipDeploy’ like below:-
To :-
And then run your pipeline to allow zip deployment of Azure Logic app.
Reference:-
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论