ARM 模板:AppSettings 的存储端点不正确,WEBSITE_CONTENTSHARE

ARM Template: Incorrect storage endpoint for AppSettings, WEBSITE_CONTENTSHARE

使用 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 亚利桑那州)。

根据测试,我知道错误是由模板中的 "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)将此配置部署到政府租户

issue/question:对我来说,这个政府租户中的模板部署过程似乎是在寻找商业端点 (file.core.windows.net)。有什么办法可以 override/correct 这个吗?

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

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