gpt4 book ai didi

azure - 在 Azure 存储帐户中创建表

转载 作者:行者123 更新时间:2023-12-03 23:23:09 25 4
gpt4 key购买 nike

有没有办法使用 ARM 模板在 Azure 存储帐户内创建表?我可以使用 PowerShell 实现这一目标,但找不到使用 JSON 模板来实现此目的的方法,而且当我使用 ( https://resources.azure.com ) 浏览部署资源时,我看不到对存储帐户下创建的表的任何引用,任何知道为什么吗?

谢谢,塞亚姆

最佳答案

您可以通过 ARM 创建一个带有表的 Azure 存储帐户,如下所示,使用 storageAccount 资源上的 tableServices/tables 子资源:

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string",
"minLength": 3,
"maxLength": 24
},
"storageAccountSku": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS"
]
},
"tableName": {
"type": "string",
"minLength": 3,
"maxLength": 63
}
},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"name": "[parameters('storageAccountName')]",
"apiVersion": "2019-06-01",
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "[parameters('storageAccountSku')]"
},
"resources": [
{
"name": "[concat('default/', parameters('tableName'))]",
"type": "tableServices/tables",
"apiVersion": "2019-06-01",
"dependsOn": [
"[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]"
]
}
]
}
]
}

该功能记录在 ARM Template spec page for tableServices/tables 上.

关于azure - 在 Azure 存储帐户中创建表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36296323/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com