我对azure是个新手。我在azure门户中创建了一个存储帐户。我需要使用ARM模板将文件上传到存储帐户。有谁能告诉我怎么做吗?
发布于 2018-11-20 18:55:28
当前不支持使用ARM模板将文件上载到Blob存储。
这背后的逻辑是,ARM模板的存在是为了管理Azure资源(执行创建、删除和更改资源属性等操作),而不是管理这些资源的使用。
可以将文件上载到Blob存储的方法包括:
通过Az Powershell命令
执行
也就是说,部署Blob Storage容器(资源本身)可以像下面的模板所示:(归功于@johndownshere)
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string"
}
},
"variables": {
"containerName": "logs"
},
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2018-02-01",
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "Standard_LRS",
"tier": "Standard"
},
"properties": {
"accessTier": "Hot"
},
"resources": [
{
"name": "[concat('default/', variables('containerName'))]",
"type": "blobServices/containers",
"apiVersion": "2018-03-01-preview",
"dependsOn": [
"[parameters('storageAccountName')]"
]
}
]
}
]
}
https://stackoverflow.com/questions/45426311
复制相似问题