1. Packages
  2. Azure Classic
  3. API Docs
  4. storage
  5. Blob

We recommend using Azure Native.

Azure v6.22.0 published on Tuesday, Apr 1, 2025 by Pulumi

azure.storage.Blob

Explore with Pulumi AI

Manages a Blob within a Storage Container.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const example = new azure.core.ResourceGroup("example", {
    name: "example-resources",
    location: "West Europe",
});
const exampleAccount = new azure.storage.Account("example", {
    name: "examplestoracc",
    resourceGroupName: example.name,
    location: example.location,
    accountTier: "Standard",
    accountReplicationType: "LRS",
});
const exampleContainer = new azure.storage.Container("example", {
    name: "content",
    storageAccountId: exampleAccount.id,
    containerAccessType: "private",
});
const exampleBlob = new azure.storage.Blob("example", {
    name: "my-awesome-content.zip",
    storageAccountName: exampleAccount.name,
    storageContainerName: exampleContainer.name,
    type: "Block",
    source: new pulumi.asset.FileAsset("some-local-file.zip"),
});
Copy
import pulumi
import pulumi_azure as azure

example = azure.core.ResourceGroup("example",
    name="example-resources",
    location="West Europe")
example_account = azure.storage.Account("example",
    name="examplestoracc",
    resource_group_name=example.name,
    location=example.location,
    account_tier="Standard",
    account_replication_type="LRS")
example_container = azure.storage.Container("example",
    name="content",
    storage_account_id=example_account.id,
    container_access_type="private")
example_blob = azure.storage.Blob("example",
    name="my-awesome-content.zip",
    storage_account_name=example_account.name,
    storage_container_name=example_container.name,
    type="Block",
    source=pulumi.FileAsset("some-local-file.zip"))
Copy
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/storage"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
			Name:     pulumi.String("example-resources"),
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAccount, err := storage.NewAccount(ctx, "example", &storage.AccountArgs{
			Name:                   pulumi.String("examplestoracc"),
			ResourceGroupName:      example.Name,
			Location:               example.Location,
			AccountTier:            pulumi.String("Standard"),
			AccountReplicationType: pulumi.String("LRS"),
		})
		if err != nil {
			return err
		}
		exampleContainer, err := storage.NewContainer(ctx, "example", &storage.ContainerArgs{
			Name:                pulumi.String("content"),
			StorageAccountId:    exampleAccount.ID(),
			ContainerAccessType: pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		_, err = storage.NewBlob(ctx, "example", &storage.BlobArgs{
			Name:                 pulumi.String("my-awesome-content.zip"),
			StorageAccountName:   exampleAccount.Name,
			StorageContainerName: exampleContainer.Name,
			Type:                 pulumi.String("Block"),
			Source:               pulumi.NewFileAsset("some-local-file.zip"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var example = new Azure.Core.ResourceGroup("example", new()
    {
        Name = "example-resources",
        Location = "West Europe",
    });

    var exampleAccount = new Azure.Storage.Account("example", new()
    {
        Name = "examplestoracc",
        ResourceGroupName = example.Name,
        Location = example.Location,
        AccountTier = "Standard",
        AccountReplicationType = "LRS",
    });

    var exampleContainer = new Azure.Storage.Container("example", new()
    {
        Name = "content",
        StorageAccountId = exampleAccount.Id,
        ContainerAccessType = "private",
    });

    var exampleBlob = new Azure.Storage.Blob("example", new()
    {
        Name = "my-awesome-content.zip",
        StorageAccountName = exampleAccount.Name,
        StorageContainerName = exampleContainer.Name,
        Type = "Block",
        Source = new FileAsset("some-local-file.zip"),
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.storage.Account;
import com.pulumi.azure.storage.AccountArgs;
import com.pulumi.azure.storage.Container;
import com.pulumi.azure.storage.ContainerArgs;
import com.pulumi.azure.storage.Blob;
import com.pulumi.azure.storage.BlobArgs;
import com.pulumi.asset.FileAsset;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new ResourceGroup("example", ResourceGroupArgs.builder()
            .name("example-resources")
            .location("West Europe")
            .build());

        var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
            .name("examplestoracc")
            .resourceGroupName(example.name())
            .location(example.location())
            .accountTier("Standard")
            .accountReplicationType("LRS")
            .build());

        var exampleContainer = new Container("exampleContainer", ContainerArgs.builder()
            .name("content")
            .storageAccountId(exampleAccount.id())
            .containerAccessType("private")
            .build());

        var exampleBlob = new Blob("exampleBlob", BlobArgs.builder()
            .name("my-awesome-content.zip")
            .storageAccountName(exampleAccount.name())
            .storageContainerName(exampleContainer.name())
            .type("Block")
            .source(new FileAsset("some-local-file.zip"))
            .build());

    }
}
Copy
resources:
  example:
    type: azure:core:ResourceGroup
    properties:
      name: example-resources
      location: West Europe
  exampleAccount:
    type: azure:storage:Account
    name: example
    properties:
      name: examplestoracc
      resourceGroupName: ${example.name}
      location: ${example.location}
      accountTier: Standard
      accountReplicationType: LRS
  exampleContainer:
    type: azure:storage:Container
    name: example
    properties:
      name: content
      storageAccountId: ${exampleAccount.id}
      containerAccessType: private
  exampleBlob:
    type: azure:storage:Blob
    name: example
    properties:
      name: my-awesome-content.zip
      storageAccountName: ${exampleAccount.name}
      storageContainerName: ${exampleContainer.name}
      type: Block
      source:
        fn::FileAsset: some-local-file.zip
Copy

Create Blob Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Blob(name: string, args: BlobArgs, opts?: CustomResourceOptions);
@overload
def Blob(resource_name: str,
         args: BlobArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def Blob(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         storage_account_name: Optional[str] = None,
         type: Optional[str] = None,
         storage_container_name: Optional[str] = None,
         name: Optional[str] = None,
         encryption_scope: Optional[str] = None,
         metadata: Optional[Mapping[str, str]] = None,
         access_tier: Optional[str] = None,
         parallelism: Optional[int] = None,
         size: Optional[int] = None,
         source: Optional[Union[pulumi.Asset, pulumi.Archive]] = None,
         source_content: Optional[str] = None,
         source_uri: Optional[str] = None,
         content_type: Optional[str] = None,
         content_md5: Optional[str] = None,
         cache_control: Optional[str] = None)
func NewBlob(ctx *Context, name string, args BlobArgs, opts ...ResourceOption) (*Blob, error)
public Blob(string name, BlobArgs args, CustomResourceOptions? opts = null)
public Blob(String name, BlobArgs args)
public Blob(String name, BlobArgs args, CustomResourceOptions options)
type: azure:storage:Blob
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. BlobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. BlobArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. BlobArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. BlobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. BlobArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var blobResource = new Azure.Storage.Blob("blobResource", new()
{
    StorageAccountName = "string",
    Type = "string",
    StorageContainerName = "string",
    Name = "string",
    EncryptionScope = "string",
    Metadata = 
    {
        { "string", "string" },
    },
    AccessTier = "string",
    Parallelism = 0,
    Size = 0,
    Source = new StringAsset("content"),
    SourceContent = "string",
    SourceUri = "string",
    ContentType = "string",
    ContentMd5 = "string",
    CacheControl = "string",
});
Copy
example, err := storage.NewBlob(ctx, "blobResource", &storage.BlobArgs{
	StorageAccountName:   pulumi.String("string"),
	Type:                 pulumi.String("string"),
	StorageContainerName: pulumi.String("string"),
	Name:                 pulumi.String("string"),
	EncryptionScope:      pulumi.String("string"),
	Metadata: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	AccessTier:    pulumi.String("string"),
	Parallelism:   pulumi.Int(0),
	Size:          pulumi.Int(0),
	Source:        pulumi.NewStringAsset("content"),
	SourceContent: pulumi.String("string"),
	SourceUri:     pulumi.String("string"),
	ContentType:   pulumi.String("string"),
	ContentMd5:    pulumi.String("string"),
	CacheControl:  pulumi.String("string"),
})
Copy
var blobResource = new Blob("blobResource", BlobArgs.builder()
    .storageAccountName("string")
    .type("string")
    .storageContainerName("string")
    .name("string")
    .encryptionScope("string")
    .metadata(Map.of("string", "string"))
    .accessTier("string")
    .parallelism(0)
    .size(0)
    .source(new StringAsset("content"))
    .sourceContent("string")
    .sourceUri("string")
    .contentType("string")
    .contentMd5("string")
    .cacheControl("string")
    .build());
Copy
blob_resource = azure.storage.Blob("blobResource",
    storage_account_name="string",
    type="string",
    storage_container_name="string",
    name="string",
    encryption_scope="string",
    metadata={
        "string": "string",
    },
    access_tier="string",
    parallelism=0,
    size=0,
    source=pulumi.StringAsset("content"),
    source_content="string",
    source_uri="string",
    content_type="string",
    content_md5="string",
    cache_control="string")
Copy
const blobResource = new azure.storage.Blob("blobResource", {
    storageAccountName: "string",
    type: "string",
    storageContainerName: "string",
    name: "string",
    encryptionScope: "string",
    metadata: {
        string: "string",
    },
    accessTier: "string",
    parallelism: 0,
    size: 0,
    source: new pulumi.asset.StringAsset("content"),
    sourceContent: "string",
    sourceUri: "string",
    contentType: "string",
    contentMd5: "string",
    cacheControl: "string",
});
Copy
type: azure:storage:Blob
properties:
    accessTier: string
    cacheControl: string
    contentMd5: string
    contentType: string
    encryptionScope: string
    metadata:
        string: string
    name: string
    parallelism: 0
    size: 0
    source:
        fn::StringAsset: content
    sourceContent: string
    sourceUri: string
    storageAccountName: string
    storageContainerName: string
    type: string
Copy

Blob Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Blob resource accepts the following input properties:

StorageAccountName
This property is required.
Changes to this property will trigger replacement.
string
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
StorageContainerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
Type
This property is required.
Changes to this property will trigger replacement.
string
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
AccessTier string
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
CacheControl string
Controls the cache control header content of the response when blob is requested .
ContentMd5 Changes to this property will trigger replacement. string
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
ContentType string
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
EncryptionScope Changes to this property will trigger replacement. string
The encryption scope to use for this blob.
Metadata Dictionary<string, string>
A map of custom blob metadata.
Name Changes to this property will trigger replacement. string
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
Parallelism Changes to this property will trigger replacement. int

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

Size Changes to this property will trigger replacement. int

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

Source Changes to this property will trigger replacement. AssetOrArchive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
SourceContent Changes to this property will trigger replacement. string
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
SourceUri Changes to this property will trigger replacement. string
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
StorageAccountName
This property is required.
Changes to this property will trigger replacement.
string
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
StorageContainerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
Type
This property is required.
Changes to this property will trigger replacement.
string
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
AccessTier string
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
CacheControl string
Controls the cache control header content of the response when blob is requested .
ContentMd5 Changes to this property will trigger replacement. string
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
ContentType string
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
EncryptionScope Changes to this property will trigger replacement. string
The encryption scope to use for this blob.
Metadata map[string]string
A map of custom blob metadata.
Name Changes to this property will trigger replacement. string
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
Parallelism Changes to this property will trigger replacement. int

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

Size Changes to this property will trigger replacement. int

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

Source Changes to this property will trigger replacement. pulumi.AssetOrArchive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
SourceContent Changes to this property will trigger replacement. string
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
SourceUri Changes to this property will trigger replacement. string
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storageAccountName
This property is required.
Changes to this property will trigger replacement.
String
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storageContainerName
This property is required.
Changes to this property will trigger replacement.
String
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
accessTier String
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cacheControl String
Controls the cache control header content of the response when blob is requested .
contentMd5 Changes to this property will trigger replacement. String
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
contentType String
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryptionScope Changes to this property will trigger replacement. String
The encryption scope to use for this blob.
metadata Map<String,String>
A map of custom blob metadata.
name Changes to this property will trigger replacement. String
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. Integer

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. Integer

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. AssetOrArchive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
sourceContent Changes to this property will trigger replacement. String
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
sourceUri Changes to this property will trigger replacement. String
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storageAccountName
This property is required.
Changes to this property will trigger replacement.
string
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storageContainerName
This property is required.
Changes to this property will trigger replacement.
string
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type
This property is required.
Changes to this property will trigger replacement.
string
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
accessTier string
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cacheControl string
Controls the cache control header content of the response when blob is requested .
contentMd5 Changes to this property will trigger replacement. string
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
contentType string
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryptionScope Changes to this property will trigger replacement. string
The encryption scope to use for this blob.
metadata {[key: string]: string}
A map of custom blob metadata.
name Changes to this property will trigger replacement. string
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. number

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. number

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. pulumi.asset.Asset | pulumi.asset.Archive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
sourceContent Changes to this property will trigger replacement. string
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
sourceUri Changes to this property will trigger replacement. string
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storage_account_name
This property is required.
Changes to this property will trigger replacement.
str
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storage_container_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type
This property is required.
Changes to this property will trigger replacement.
str
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
access_tier str
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cache_control str
Controls the cache control header content of the response when blob is requested .
content_md5 Changes to this property will trigger replacement. str
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
content_type str
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryption_scope Changes to this property will trigger replacement. str
The encryption scope to use for this blob.
metadata Mapping[str, str]
A map of custom blob metadata.
name Changes to this property will trigger replacement. str
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. int

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. int

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. Union[pulumi.Asset, pulumi.Archive]
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
source_content Changes to this property will trigger replacement. str
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
source_uri Changes to this property will trigger replacement. str
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storageAccountName
This property is required.
Changes to this property will trigger replacement.
String
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storageContainerName
This property is required.
Changes to this property will trigger replacement.
String
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type
This property is required.
Changes to this property will trigger replacement.
String
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
accessTier String
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cacheControl String
Controls the cache control header content of the response when blob is requested .
contentMd5 Changes to this property will trigger replacement. String
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
contentType String
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryptionScope Changes to this property will trigger replacement. String
The encryption scope to use for this blob.
metadata Map<String>
A map of custom blob metadata.
name Changes to this property will trigger replacement. String
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. Number

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. Number

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. Asset
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
sourceContent Changes to this property will trigger replacement. String
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
sourceUri Changes to this property will trigger replacement. String
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.

Outputs

All input properties are implicitly available as output properties. Additionally, the Blob resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Url string
The URL of the blob
Id string
The provider-assigned unique ID for this managed resource.
Url string
The URL of the blob
id String
The provider-assigned unique ID for this managed resource.
url String
The URL of the blob
id string
The provider-assigned unique ID for this managed resource.
url string
The URL of the blob
id str
The provider-assigned unique ID for this managed resource.
url str
The URL of the blob
id String
The provider-assigned unique ID for this managed resource.
url String
The URL of the blob

Look up Existing Blob Resource

Get an existing Blob resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: BlobState, opts?: CustomResourceOptions): Blob
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        access_tier: Optional[str] = None,
        cache_control: Optional[str] = None,
        content_md5: Optional[str] = None,
        content_type: Optional[str] = None,
        encryption_scope: Optional[str] = None,
        metadata: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        parallelism: Optional[int] = None,
        size: Optional[int] = None,
        source: Optional[Union[pulumi.Asset, pulumi.Archive]] = None,
        source_content: Optional[str] = None,
        source_uri: Optional[str] = None,
        storage_account_name: Optional[str] = None,
        storage_container_name: Optional[str] = None,
        type: Optional[str] = None,
        url: Optional[str] = None) -> Blob
func GetBlob(ctx *Context, name string, id IDInput, state *BlobState, opts ...ResourceOption) (*Blob, error)
public static Blob Get(string name, Input<string> id, BlobState? state, CustomResourceOptions? opts = null)
public static Blob get(String name, Output<String> id, BlobState state, CustomResourceOptions options)
resources:  _:    type: azure:storage:Blob    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccessTier string
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
CacheControl string
Controls the cache control header content of the response when blob is requested .
ContentMd5 Changes to this property will trigger replacement. string
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
ContentType string
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
EncryptionScope Changes to this property will trigger replacement. string
The encryption scope to use for this blob.
Metadata Dictionary<string, string>
A map of custom blob metadata.
Name Changes to this property will trigger replacement. string
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
Parallelism Changes to this property will trigger replacement. int

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

Size Changes to this property will trigger replacement. int

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

Source Changes to this property will trigger replacement. AssetOrArchive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
SourceContent Changes to this property will trigger replacement. string
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
SourceUri Changes to this property will trigger replacement. string
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
StorageAccountName Changes to this property will trigger replacement. string
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
StorageContainerName Changes to this property will trigger replacement. string
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
Type Changes to this property will trigger replacement. string
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
Url string
The URL of the blob
AccessTier string
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
CacheControl string
Controls the cache control header content of the response when blob is requested .
ContentMd5 Changes to this property will trigger replacement. string
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
ContentType string
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
EncryptionScope Changes to this property will trigger replacement. string
The encryption scope to use for this blob.
Metadata map[string]string
A map of custom blob metadata.
Name Changes to this property will trigger replacement. string
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
Parallelism Changes to this property will trigger replacement. int

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

Size Changes to this property will trigger replacement. int

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

Source Changes to this property will trigger replacement. pulumi.AssetOrArchive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
SourceContent Changes to this property will trigger replacement. string
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
SourceUri Changes to this property will trigger replacement. string
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
StorageAccountName Changes to this property will trigger replacement. string
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
StorageContainerName Changes to this property will trigger replacement. string
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
Type Changes to this property will trigger replacement. string
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
Url string
The URL of the blob
accessTier String
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cacheControl String
Controls the cache control header content of the response when blob is requested .
contentMd5 Changes to this property will trigger replacement. String
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
contentType String
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryptionScope Changes to this property will trigger replacement. String
The encryption scope to use for this blob.
metadata Map<String,String>
A map of custom blob metadata.
name Changes to this property will trigger replacement. String
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. Integer

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. Integer

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. AssetOrArchive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
sourceContent Changes to this property will trigger replacement. String
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
sourceUri Changes to this property will trigger replacement. String
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storageAccountName Changes to this property will trigger replacement. String
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storageContainerName Changes to this property will trigger replacement. String
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type Changes to this property will trigger replacement. String
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
url String
The URL of the blob
accessTier string
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cacheControl string
Controls the cache control header content of the response when blob is requested .
contentMd5 Changes to this property will trigger replacement. string
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
contentType string
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryptionScope Changes to this property will trigger replacement. string
The encryption scope to use for this blob.
metadata {[key: string]: string}
A map of custom blob metadata.
name Changes to this property will trigger replacement. string
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. number

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. number

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. pulumi.asset.Asset | pulumi.asset.Archive
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
sourceContent Changes to this property will trigger replacement. string
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
sourceUri Changes to this property will trigger replacement. string
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storageAccountName Changes to this property will trigger replacement. string
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storageContainerName Changes to this property will trigger replacement. string
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type Changes to this property will trigger replacement. string
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
url string
The URL of the blob
access_tier str
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cache_control str
Controls the cache control header content of the response when blob is requested .
content_md5 Changes to this property will trigger replacement. str
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
content_type str
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryption_scope Changes to this property will trigger replacement. str
The encryption scope to use for this blob.
metadata Mapping[str, str]
A map of custom blob metadata.
name Changes to this property will trigger replacement. str
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. int

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. int

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. Union[pulumi.Asset, pulumi.Archive]
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
source_content Changes to this property will trigger replacement. str
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
source_uri Changes to this property will trigger replacement. str
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storage_account_name Changes to this property will trigger replacement. str
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storage_container_name Changes to this property will trigger replacement. str
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type Changes to this property will trigger replacement. str
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
url str
The URL of the blob
accessTier String
The access tier of the storage blob. Possible values are Archive, Cool and Hot.
cacheControl String
Controls the cache control header content of the response when blob is requested .
contentMd5 Changes to this property will trigger replacement. String
The MD5 sum of the blob contents. Cannot be defined if source_uri is defined, or if blob type is Append or Page. Changing this forces a new resource to be created.
contentType String
The content type of the storage blob. Cannot be defined if source_uri is defined. Defaults to application/octet-stream.
encryptionScope Changes to this property will trigger replacement. String
The encryption scope to use for this blob.
metadata Map<String>
A map of custom blob metadata.
name Changes to this property will trigger replacement. String
The name of the storage blob. Must be unique within the storage container the blob is located. Changing this forces a new resource to be created.
parallelism Changes to this property will trigger replacement. Number

The number of workers per CPU core to run for concurrent uploads. Defaults to 8. Changing this forces a new resource to be created.

NOTE: parallelism is only applicable for Page blobs - support for Block Blobs is blocked on the upstream issue.

size Changes to this property will trigger replacement. Number

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. Changing this forces a new resource to be created.

Note: size is required if source_uri is not set.

source Changes to this property will trigger replacement. Asset
An absolute path to a file on the local system. This field cannot be specified for Append blobs and cannot be specified if source_content or source_uri is specified. Changing this forces a new resource to be created.
sourceContent Changes to this property will trigger replacement. String
The content for this blob which should be defined inline. This field can only be specified for Block blobs and cannot be specified if source or source_uri is specified. Changing this forces a new resource to be created.
sourceUri Changes to this property will trigger replacement. String
The URI of an existing blob, or a file in the Azure File service, to use as the source contents for the blob to be created. Changing this forces a new resource to be created. This field cannot be specified for Append blobs and cannot be specified if source or source_content is specified.
storageAccountName Changes to this property will trigger replacement. String
Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
storageContainerName Changes to this property will trigger replacement. String
The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
type Changes to this property will trigger replacement. String
The type of the storage blob to be created. Possible values are Append, Block or Page. Changing this forces a new resource to be created.
url String
The URL of the blob

Import

Storage Blob’s can be imported using the resource id, e.g.

$ pulumi import azure:storage/blob:Blob blob1 https://example.blob.core.windows.net/container/blob.vhd
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.