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

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

azure.storage.Blob

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi

    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",
        storageAccountName: exampleAccount.name,
        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"),
    });
    
    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_name=example_account.name,
        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"))
    
    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"),
    			StorageAccountName:  exampleAccount.Name,
    			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
    	})
    }
    
    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",
            StorageAccountName = exampleAccount.Name,
            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"),
        });
    
    });
    
    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")
                .storageAccountName(exampleAccount.name())
                .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());
    
        }
    }
    
    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
          storageAccountName: ${exampleAccount.name}
          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
    

    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 string
    The unique name of the resource.
    args BlobArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args 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 string
    The unique name of the resource.
    args BlobArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BlobArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
    });
    
    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"),
    })
    
    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());
    
    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")
    
    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",
    });
    
    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
    

    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

    The Blob resource accepts the following input properties:

    StorageAccountName string
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    StorageContainerName string
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    Type 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 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 string
    The encryption scope to use for this blob.
    Metadata Dictionary<string, string>
    A map of custom blob metadata.
    Name 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 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 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 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 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 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 string
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    StorageContainerName string
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    Type 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 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 string
    The encryption scope to use for this blob.
    Metadata map[string]string
    A map of custom blob metadata.
    Name 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 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 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 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 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 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 String
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storageContainerName String
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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 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 String
    The encryption scope to use for this blob.
    metadata Map<String,String>
    A map of custom blob metadata.
    name 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 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 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 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 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 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 string
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storageContainerName string
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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 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 string
    The encryption scope to use for this blob.
    metadata {[key: string]: string}
    A map of custom blob metadata.
    name 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 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 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 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 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 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 str
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storage_container_name str
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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 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 str
    The encryption scope to use for this blob.
    metadata Mapping[str, str]
    A map of custom blob metadata.
    name 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 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 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 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 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 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 String
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storageContainerName String
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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 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 String
    The encryption scope to use for this blob.
    metadata Map<String>
    A map of custom blob metadata.
    name 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 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 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 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 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 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)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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 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 string
    The encryption scope to use for this blob.
    Metadata Dictionary<string, string>
    A map of custom blob metadata.
    Name 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 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 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 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 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 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 string
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    StorageContainerName string
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    Type 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 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 string
    The encryption scope to use for this blob.
    Metadata map[string]string
    A map of custom blob metadata.
    Name 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 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 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 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 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 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 string
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    StorageContainerName string
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    Type 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 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 String
    The encryption scope to use for this blob.
    metadata Map<String,String>
    A map of custom blob metadata.
    name 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 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 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 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 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 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 String
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storageContainerName String
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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 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 string
    The encryption scope to use for this blob.
    metadata {[key: string]: string}
    A map of custom blob metadata.
    name 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 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 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 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 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 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 string
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storageContainerName string
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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 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 str
    The encryption scope to use for this blob.
    metadata Mapping[str, str]
    A map of custom blob metadata.
    name 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 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 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 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 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 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 str
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storage_container_name str
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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 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 String
    The encryption scope to use for this blob.
    metadata Map<String>
    A map of custom blob metadata.
    name 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 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 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 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 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 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 String
    Specifies the storage account in which to create the storage container. Changing this forces a new resource to be created.
    storageContainerName String
    The name of the storage container in which this blob should be created. Changing this forces a new resource to be created.
    type 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
    

    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.
    azure logo

    We recommend using Azure Native.

    Azure Classic v6.2.0 published on Friday, Sep 27, 2024 by Pulumi