azure - ARM 模板 : Incorrect storage endpoint for AppSettings, WEBSITE_CONTENTSHARE

标签 azure azure-functions azure-cli azure-gov

使用 ARM 模板将 Azure 函数部署到 USGov Arizona 时出现错误。模板适用于 Azure 商业版。 错误是:

12:34:11 - 12:33:27 PM - Resource Microsoft.Web/sites/config 'SFGovAppService/appsettings' failed with message '{
12:34:11 -   "Code": "BadRequest",
12:34:11 -   "Message": "There was a conflict. The remote name could not be resolved: 'sftestgovstorage.file.core.windows.net'",
12:34:11 -   "Target": null,
12:34:11 -   "Details": [
12:34:11 -     {
12:34:11 -       "Message": "There was a conflict. The remote name could not be resolved: 'sftestgovstorage.file.core.windows.net'"
12:34:11 -     },
12:34:11 -     {
12:34:11 -       "Code": "BadRequest"
12:34:11 -     },
12:34:11 -     {
12:34:11 -       "ErrorEntity": {
12:34:11 -         "ExtendedCode": "01020",
12:34:11 -         "MessageTemplate": "There was a conflict. {0}",
12:34:11 -         "Parameters": [
12:34:11 -           "The remote name could not be resolved: 'sftestgovstorage.file.core.windows.net'"
12:34:11 -         ],
12:34:11 -         "Code": "BadRequest",
12:34:11 -         "Message": "There was a conflict. The remote name could not be resolved: 'sftestgovstorage.file.core.windows.net'"
12:34:11 -       }
12:34:11 -     }
12:34:11 -   ],
12:34:11 -   "Innererror": null
12:34:11 - }'

我在 https://sftestgovstorage.file.core.usgovcloudapi.net/ 有一个成功部署的文件服务端点,在同一资源组、同一位置(USGov Arizona)。

根据测试,我知道该错误是由模板中的“WEBSITE_CONTENTSHARE”属性引起的:(“~” = 我已删除以缩短此代码的代码。)

{
  "comments": "Adventos SmartForce Function App Service",
  "type": "Microsoft.Web/sites",
  "kind": "functionapp",
  "name": "[parameters('appServiceName')]",
  "apiVersion": "2016-08-01",
  "location": "[resourceGroup().location]",
  "scale": null,
  "properties": {
    "enabled": true,
    "hostNameSslStates": [
~~~~~~~~~~~~~~
    ],
~~~~~~~~~~~~
  },
  "dependsOn": [
    "[resourceId('Microsoft.Web/serverfarms', parameters('appServicePlanName'))]"
  ],
  "resources": [
    {
      "name": "appsettings",
      "type": "config",
      "apiVersion": "2015-08-01",
      "dependsOn": [
        "[resourceId('Microsoft.Web/sites', parameters('appServiceName'))]"
      ],
      "properties": {
        "AzureWebJobsDashboard": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').ApiVersions[0]).keys[0].value)]",
        "AzureWebJobsStorage": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').ApiVersions[0]).keys[0].value)]",
        "WEBSITE_CONTENTAZUREFILECONNECTIONSTRING": "[concat('DefaultEndpointsProtocol=https;AccountName=', parameters('storageAccountName'), ';AccountKey=', listKeys(variables('storageAccountId'), providers('Microsoft.Storage', 'storageAccounts').ApiVersions[0]).keys[0].value)]",
        "WEBSITE_CONTENTSHARE": "[toLower(deployment().name)]",
        "FUNCTIONS_EXTENSION_VERSION": "~1",
        "WEBSITE_NODE_DEFAULT_VERSION": "6.5.0",
~~~~~~~~~~~~~~~~~~
      }
    }
  ]
},

我确实知道 AppSetting 部署有效,因为我已经能够使用 PUT REST 调用(通过 Fiddler)将此配置部署到政府租户

问题:对我来说,这个政府租户中的模板部署过程似乎是在寻找商业端点 (file.core.windows.net)。有没有办法可以覆盖/纠正这个问题?

最佳答案

WEBSITE_CONTENTAZUREFILECONNECTIONSTRINGWEBSITE_CONTENTSHARE 只能用于在消费模式下运行的函数应用,而 Azure 政府目前不支持消费。

尝试完全忽略这两个设置。

关于azure - ARM 模板 : Incorrect storage endpoint for AppSettings, WEBSITE_CONTENTSHARE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47400201/

相关文章:

python - 如何使用内部 pypi 构建/部署 Python Azure Function App

azure - 使用 az 存储实体查询时出现不一致的授权警告和错误

azure - 如何使用不同的标签无缝标记 Azure 资源

Azure B2C 设置

azure - Selenium 和 Azure Web 应用程序

Azure函数队列触发器远远落后

node.js - Azure 函数 Sendgrid 附件已损坏

azure - 如何读取使用 Azure AD 身份验证的 Jenkins 中的队列状态?

azure - Power BI 始终返回 403 Forbidden

azure - 如何指定包含 & 符号的 Azure 应用程序配置值?