[英]Facing Issues on Deploying template for Azure File Share Storage Account
我正在嘗試創建一個包含文件共享和 rest 服務的存儲帳戶。 當我執行模板時,它會拋出以下錯誤。
狀態消息:指定的 XML 在語法上無效。 RequestId:5be13537-701a-0056-1f1d-0a506f000000 時間:2021-02-23T19:53:49.1937194Z(代碼:InvalidXmlDocument)CorrelationId:21fe81f4-b917-4813-ade5-9b96f3b688d6
存儲帳戶的 blob、隊列、表獲取預配不知道為什么它會在文件共享預配上引發錯誤。 任何幫助家伙。
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountname": {
"type": "String"
},
"location": {
"type": "String"
},
"skuname": {
"type": "String"
},
"tags": {
"type": "Object"
},
"accessTier": {
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2020-08-01-preview",
"name": "[parameters('storageAccountname')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"sku": {
"name": "[parameters('skuname')]",
"tier": "Standard"
},
"kind": "StorageV2",
"properties": {
"allowBlobPublicAccess": true,
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": true,
"encryption": {
"services": {
"file": {
"keyType": "Account",
"enabled": true
},
"blob": {
"keyType": "Account",
"enabled": true
}
},
"keySource": "Microsoft.Storage"
},
"accessTier": "[parameters('accessTier')]"
}
},
{
"type": "Microsoft.Storage/storageAccounts/fileServices",
"apiVersion": "2020-08-01-preview",
"name": "[concat(parameters('storageAccountname'), '/default')]",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountname'))]"
],
"sku": {
"name": "[parameters('skuname')]",
"tier": "Standard"
},
"properties": {
"protocolSettings": {
"smb": {}
},
"cors": {
"corsRules": []
},
"shareDeleteRetentionPolicy": {
"enabled": true,
"days": 7
}
}
}
]
}
是的,當存儲帳戶類型更改為 StorageV2 時,允許我添加文件共享。
在此azure 快速入門模板中,我們在創建標准存儲帳戶時不需要提供Microsoft.Storage/storageAccounts/fileServices
類型的資源。
當我們只包含類型為StorageV2的資源Microsoft.Storage/storageAccounts
時,它將同時提供所有這些服務: blobServices
、 fileServices
、 queueServices
、 tableServices
。
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"name": "[parameters('storageAccountName')]",
"location": "[parameters('location')]",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"accessTier": "Hot"
}
},
如果您只想創建文件服務,您可以 select 一種具有高級性能層的FileStorage類型的存儲帳戶類型。 像這樣的工作示例:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountname": {
"type": "String"
},
"location": {
"type": "String"
},
"skuname": {
"type": "String"
},
"tags": {
"type": "Object"
}
// "accessTier": {
// "type": "String"
// }
},
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2020-08-01-preview",
"name": "[parameters('storageAccountname')]",
"location": "[parameters('location')]",
"tags": "[parameters('tags')]",
"sku": {
"name": "[parameters('skuname')]",
"tier": "Premium"
},
"kind": "FileStorage",
"properties": {
"allowBlobPublicAccess": true,
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": true,
"encryption": {
"services": {
"file": {
"keyType": "Account",
"enabled": true
},
"blob": {
"keyType": "Account",
"enabled": true
}
},
"keySource": "Microsoft.Storage"
}
// "accessTier": "[parameters('accessTier')]"
}
}
]
}
有關詳細信息,請閱讀https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#performance-tiers
我遇到了同樣的錯誤,並用空的“SMB”條目將其追蹤到“protocolSettings”。 從我的模板中刪除該塊消除了錯誤,並且使用默認值創建了資源。
可能沒有必要包含文件服務資源類型,但我將包含所有四個(blob、文件、隊列和表)作為標准做法,以防我以后想要添加容器/共享/等。 在模板中,因此對他們父母的引用將起作用(並在幾個月后查看模板時保持我記憶結構的理智。)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.