如何抑制警告 “ZipDeploy 验证警告: 建议设置应用设置 WEBSITE_RUN_FROM_PACKAGE = 1”

huangapple go评论66阅读模式
英文:

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,除非你正在针对以下情况之一:

  1. 使用门户编辑。
  2. 运行部署后脚本。
  3. 需要在 wwwroot 中具有写入权限。
  4. 使用具有特殊要求的自定义处理程序。
    注意:如果你决定更新应用程序设置 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,如下所示:

如何抑制警告 “ZipDeploy 验证警告: 建议设置应用设置 WEBSITE_RUN_FROM_PACKAGE = 1”

更改为:

如何抑制警告 “ZipDeploy 验证警告: 建议设置应用设置 WEBSITE_RUN_FROM_PACKAGE = 1”

然后运行你的流水线以允许 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:-

如何抑制警告 “ZipDeploy 验证警告: 建议设置应用设置 WEBSITE_RUN_FROM_PACKAGE = 1”

To :-

如何抑制警告 “ZipDeploy 验证警告: 建议设置应用设置 WEBSITE_RUN_FROM_PACKAGE = 1”

And then run your pipeline to allow zip deployment of Azure Logic app.

Reference:-

AzureFunctionApp@1 Gives a warning about something it removes itself · Issue #17580 · microsoft/azure-pipelines-tasks · GitHub

huangapple
  • 本文由 发表于 2023年2月14日 22:30:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/75449284.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定