使用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)。有没有办法可以覆盖/纠正这个?
答案 0 :(得分:3)
WEBSITE_CONTENTAZUREFILECONNECTIONSTRING
和WEBSITE_CONTENTSHARE
只应用于在消费模式下运行的功能应用,而Azure政府目前不支持消费。
尝试完全省略这两个设置。