本文介绍了使用ARM模板启用Azure StorageV2静态网站(预览)功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Im trying to write an ARM template that creates a storage account with the new static website (preview) feature:

当我转到自动化脚本"刀片时,在ARM模板中看不到任何相关设置:

When I go to the Automation Script blade I don't see any related settings within the ARM template:

{
    "$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模板启用该功能?

I also don't see any related settings within the Azure Resource Explorer. I am aware that I have to use a newer API version as well but I don't know how to enable the feature using an ARM Template?

推荐答案

我不认为您可以(至少到今天为止).ARM模板用于控制 Control Plane ,而 静态网站设置 功能作为数据平面的一部分公开,可以通过 存储服务REST API .

I don't think you can (at least as of today). ARM templates are meant for controlling the Control Plane whereas Static Websites Settings feature is exposed as part of Data Plane which is accessed by Storage Service REST API.

随着宣布用于Azure存储的 RBAC (和Azure AD角色),我看到在 Storage Resource Provider API 中可以使用Storage Service REST API进行的某些操作>,所以我猜想早晚该功能也将在此公开.然后,您应该可以通过ARM模板对其进行配置.

With the announcement of RBAC (and Azure AD roles) for Azure Storage, I am seeing some of the operations from Storage Service REST API becoming available in Storage Resource Provider API, so my guess is that sooner or later this functionality will be exposed there as well. Then you should be able to configure it through ARM templates.

这篇关于使用ARM模板启用Azure StorageV2静态网站(预览)功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 01:24