使用 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)。有没有办法可以覆盖/纠正这个?