简体   繁体   English

为 Azure 文件共享存储帐户部署模板时面临的问题

[英]Facing Issues on Deploying template for Azure File Share Storage Account

I am trying to create a storage account with file share and the rest of the services included.我正在尝试创建一个包含文件共享和 rest 服务的存储帐户。 when I execute the template it throws the below error.当我执行模板时,它会抛出以下错误。

Status Message: XML specified is not syntactically valid.状态消息:指定的 XML 在语法上无效。 RequestId:5be13537-701a-0056-1f1d-0a506f000000 Time:2021-02-23T19:53:49.1937194Z (Code:InvalidXmlDocument) CorrelationId: 21fe81f4-b917-4813-ade5-9b96f3b688d6 RequestId:5be13537-701a-0056-1f1d-0a506f000000 时间:2021-02-23T19:53:49.1937194Z(代码:InvalidXmlDocument)CorrelationId:21fe81f4-b917-4813-ade5-9b96f3b688d6

The storage account's blob, queue, table get provisioned don't know why it throws an error on file share provisioning.存储帐户的 blob、队列、表获取预配不知道为什么它会在文件共享预配上引发错误。 Any help guys.任何帮助家伙。

{
    "$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
                }
            }
        }
    ]
}

Yes, when the storage account kind is changed to StorageV2, is allowing me to add fileshare.是的,当存储帐户类型更改为 StorageV2 时,允许我添加文件共享。

From this azure quickstart template , we don't need to provide the resource of the type Microsoft.Storage/storageAccounts/fileServices when you create a standard storage account.在此azure 快速入门模板中,我们在创建标准存储帐户时不需要提供Microsoft.Storage/storageAccounts/fileServices类型的资源。

When we only include resource Microsoft.Storage/storageAccounts with kind StorageV2 , it will provision all these services: blobServices , fileServices , queueServices , tableServices at the same time.当我们只包含类型为StorageV2的资源Microsoft.Storage/storageAccounts时,它将同时提供所有这些服务: blobServicesfileServicesqueueServicestableServices

{
    "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"
    }
},

If you only would like to create fileservices, you could select a FileStorage kind of storage account type with Premium performance tiers.如果您只想创建文件服务,您可以 select 一种具有高级性能层的FileStorage类型的存储帐户类型。 The working sample like this:像这样的工作示例:

{
    "$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')]"
            }
        }
    ]
}

For more information, read https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#performance-tiers有关详细信息,请阅读https://docs.microsoft.com/en-us/azure/storage/common/storage-account-overview#performance-tiers

I was running into the same error and chased it down to the "protocolSettings" with the empty "SMB" entry.我遇到了同样的错误,并用空的“SMB”条目将其追踪到“protocolSettings”。 Removing that block from my template eliminated the error and the resource was created with the default values.从我的模板中删除该块消除了错误,并且使用默认值创建了资源。

It may not be necessary to include the fileservices resource type, but I make it a standard practice to include all four (blob, file, queue, and table) in case I later want to add containers/shares/etc.可能没有必要包含文件服务资源类型,但我将包含所有四个(blob、文件、队列和表)作为标准做法,以防我以后想要添加容器/共享/等。 in the template so the references to their parents will work (and to maintain my sanity in remembering the structure when I look at the template months later.)在模板中,因此对他们父母的引用将起作用(并在几个月后查看模板时保持我记忆结构的理智。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ARM 存储帐户上的文件共享模板 - ARM Template for FileShare on Storage Account Azure 存储帐户 - 跟踪 SAS 消耗 - Azure Storage Account - Tracking the SAS consumption Terraform 设置 azure 存储帐户 virtual.network - Terraform set azure storage account virtual network 什么是正确的 su.net 委托 Azure 存储帐户? - What is the correct subnet Delegate Azure Storage account? Azure 存储帐户网络选项卡未显示/可访问 - Azure Storage Account Networking Tab is not shown/Accessible Azure SAS blob 存储帐户的令牌不起作用 - Azure SAS token for blob storage account not working 如何从Azure数据湖(存储账户)中读取R中的一个数据文件 - How to read a data file in R from Azure data lake (storage account) ARM 模板 - 存储帐户 - 将专用终结点添加到现有存储帐户 - ARM template - storage account - add private endpoint to existing storage account Azure function C#:写入 Azure 上的块 blob(csv 文件)存储帐户创建了两个版本的 blob - Azure function C#: Writing to Block blob (csv file) on Azure Storage Account creates two versions of the blob Output Azure Function powershell值到azure存储账户 - Output Azure Function powershell value to azure storage account
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM