我正在尝试编写一个 ARM 模板,该模板使用新的静态网站(预览)功能创建存储帐户:
当我转到自动化脚本边栏选项卡时,我在 ARM 模板中没有看到任何相关设置:
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccounts_spastore_name": {
"defaultValue": "spastore",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.Storage/storageAccounts",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"kind": "StorageV2",
"name": "[parameters('storageAccounts_spastore_name')]",
"apiVersion": "2018-02-01",
"location": "westeurope",
"tags": {
"purpose": "example"
},
"scale": null,
"properties": {
"networkAcls": {
"bypass": "AzureServices",
"virtualNetworkRules": [],
"ipRules": [],
"defaultAction": "Allow"
},
"supportsHttpsTrafficOnly": false,
"encryption": {
"services": {
"file": {
"enabled": true
},
"blob": {
"enabled": true
}
},
"keySource": "Microsoft.Storage"
},
"accessTier": "Hot"
},
"dependsOn": []
}
]
}
我在 Azure 资源浏览器中也没有看到任何相关设置。我知道我还必须使用较新的 API 版本,但我不知道如何使用 ARM 模板启用该功能?
最佳答案
我认为你做不到(至少从今天开始)。 ARM 模板用于控制控制平面
,而 Static Websites Settings
该功能作为数据平面
的一部分公开,可通过 Storage Service REST API
访问。 .
随着 Azure 存储的 RBAC
(和 Azure AD 角色)的发布,我发现存储服务 REST API 中的一些操作在存储资源提供程序 API
中可用>,所以我的猜测是这个功能迟早也会在那里公开。然后您应该能够通过 ARM 模板对其进行配置。
关于azure - 使用 ARM 模板启用 Azure StorageV2 静态网站(预览)功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51149262/