github.com/vtorhonen/terraform@v0.9.0-beta2.0.20170307220345-5d894e4ffda7/website/source/docs/providers/azurerm/r/storage_blob.html.markdown (about) 1 --- 2 layout: "azurerm" 3 page_title: "Azure Resource Manager: azurerm_storage_blob" 4 sidebar_current: "docs-azurerm-resource-storage-blob" 5 description: |- 6 Create a Azure Storage Blob. 7 --- 8 9 # azurerm\_storage\_blob 10 11 Create an Azure Storage Blob. 12 13 ## Example Usage 14 15 ``` 16 resource "azurerm_resource_group" "test" { 17 name = "acctestrg-%d" 18 location = "westus" 19 } 20 21 resource "azurerm_storage_account" "test" { 22 name = "acctestacc%s" 23 resource_group_name = "${azurerm_resource_group.test.name}" 24 location = "westus" 25 account_type = "Standard_LRS" 26 } 27 28 resource "azurerm_storage_container" "test" { 29 name = "vhds" 30 resource_group_name = "${azurerm_resource_group.test.name}" 31 storage_account_name = "${azurerm_storage_account.test.name}" 32 container_access_type = "private" 33 } 34 35 resource "azurerm_storage_blob" "testsb" { 36 name = "sample.vhd" 37 38 resource_group_name = "${azurerm_resource_group.test.name}" 39 storage_account_name = "${azurerm_storage_account.test.name}" 40 storage_container_name = "${azurerm_storage_container.test.name}" 41 42 type = "page" 43 size = 5120 44 } 45 ``` 46 47 ## Argument Reference 48 49 The following arguments are supported: 50 51 * `name` - (Required) The name of the storage blob. Must be unique within the storage container the blob is located. 52 53 * `resource_group_name` - (Required) The name of the resource group in which to 54 create the storage container. Changing this forces a new resource to be created. 55 56 * `storage_account_name` - (Required) Specifies the storage account in which to create the storage container. 57 Changing this forces a new resource to be created. 58 59 * `storage_container_name` - (Required) The name of the storage container in which this blob should be created. 60 61 * `type` - (Optional) The type of the storage blob to be created. One of either `block` or `page`. When not copying from an existing blob, 62 this becomes required. 63 64 * `size` - (Optional) Used only for `page` blobs to specify the size in bytes of the blob to be created. Must be a multiple of 512. Defaults to 0. 65 66 * `source` - (Optional) An absolute path to a file on the local system. Cannot be defined if `source_uri` is defined. 67 68 * `source_uri` - (Optional) The URI of an existing blob, or a file in the Azure File service, to use as the source contents 69 for the blob to be created. Changing this forces a new resource to be created. Cannot be defined if `source` is defined. 70 71 * `parallelism` - (Optional) The number of workers per CPU core to run for concurrent uploads. Defaults to `8`. 72 73 * `attempts` - (Optional) The number of attempts to make per page or block when uploading. Defaults to `1`. 74 75 ## Attributes Reference 76 77 The following attributes are exported in addition to the arguments listed above: 78 79 * `id` - The storage blob Resource ID. 80 * `url` - The URL of the blob