azure - 使用 ARM 模板启用 Azure StorageV2 静态网站(预览)功能

标签 azure azure-storage azure-blob-storage azure-resource-manager

我正在尝试编写一个 ARM 模板,该模板使用新的静态网站(预览)功能创建存储帐户:

enter image description here

当我转到自动化脚本边栏选项卡时,我在 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/

相关文章:

azure - 表存储-数据工厂中的动态查询

c# - 无法在 Visual Studio 中添加对 Visual C# 控制台应用程序的引用

c# - 使用 C# 库还原 azure blob 快照

azure - 调用 CreateIfNotExists(Azure blob 客户端)时出现异常

php - 新的 Azure PHP API -generateSharedAccessUrl

azure - Blob.getCopyState() 返回 null

python - 无需绑定(bind)即可访问 Blob 存储?

azure - 从 ServiceRuntime : FAIL 获取 "StorageConnectionString"

azure - 在直接模式下,哪些数据通过网关连接到 CosmosDB?

c# - 无法从 Azure 获取队列长度/消息计数