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

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

azure.storage.getBlob

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure Classic v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi

    Use this data source to access information about an existing Storage Blob.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.storage.getBlob({
        name: "example-blob-name",
        storageAccountName: "example-storage-account-name",
        storageContainerName: "example-storage-container-name",
    });
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.storage.get_blob(name="example-blob-name",
        storage_account_name="example-storage-account-name",
        storage_container_name="example-storage-container-name")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := storage.LookupBlob(ctx, &storage.LookupBlobArgs{
    			Name:                 "example-blob-name",
    			StorageAccountName:   "example-storage-account-name",
    			StorageContainerName: "example-storage-container-name",
    		}, nil)
    		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 = Azure.Storage.GetBlob.Invoke(new()
        {
            Name = "example-blob-name",
            StorageAccountName = "example-storage-account-name",
            StorageContainerName = "example-storage-container-name",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azure.storage.StorageFunctions;
    import com.pulumi.azure.storage.inputs.GetBlobArgs;
    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) {
            final var example = StorageFunctions.getBlob(GetBlobArgs.builder()
                .name("example-blob-name")
                .storageAccountName("example-storage-account-name")
                .storageContainerName("example-storage-container-name")
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:storage:getBlob
          Arguments:
            name: example-blob-name
            storageAccountName: example-storage-account-name
            storageContainerName: example-storage-container-name
    

    Using getBlob

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getBlob(args: GetBlobArgs, opts?: InvokeOptions): Promise<GetBlobResult>
    function getBlobOutput(args: GetBlobOutputArgs, opts?: InvokeOptions): Output<GetBlobResult>
    def get_blob(metadata: Optional[Mapping[str, str]] = None,
                 name: Optional[str] = None,
                 storage_account_name: Optional[str] = None,
                 storage_container_name: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetBlobResult
    def get_blob_output(metadata: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 storage_account_name: Optional[pulumi.Input[str]] = None,
                 storage_container_name: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetBlobResult]
    func LookupBlob(ctx *Context, args *LookupBlobArgs, opts ...InvokeOption) (*LookupBlobResult, error)
    func LookupBlobOutput(ctx *Context, args *LookupBlobOutputArgs, opts ...InvokeOption) LookupBlobResultOutput

    > Note: This function is named LookupBlob in the Go SDK.

    public static class GetBlob 
    {
        public static Task<GetBlobResult> InvokeAsync(GetBlobArgs args, InvokeOptions? opts = null)
        public static Output<GetBlobResult> Invoke(GetBlobInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetBlobResult> getBlob(GetBlobArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: azure:storage/getBlob:getBlob
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    The name of the Blob.
    StorageAccountName string
    The name of the Storage Account where the Container exists.
    StorageContainerName string
    The name of the Storage Container where the Blob exists.
    Metadata Dictionary<string, string>
    A map of custom blob metadata.
    Name string
    The name of the Blob.
    StorageAccountName string
    The name of the Storage Account where the Container exists.
    StorageContainerName string
    The name of the Storage Container where the Blob exists.
    Metadata map[string]string
    A map of custom blob metadata.
    name String
    The name of the Blob.
    storageAccountName String
    The name of the Storage Account where the Container exists.
    storageContainerName String
    The name of the Storage Container where the Blob exists.
    metadata Map<String,String>
    A map of custom blob metadata.
    name string
    The name of the Blob.
    storageAccountName string
    The name of the Storage Account where the Container exists.
    storageContainerName string
    The name of the Storage Container where the Blob exists.
    metadata {[key: string]: string}
    A map of custom blob metadata.
    name str
    The name of the Blob.
    storage_account_name str
    The name of the Storage Account where the Container exists.
    storage_container_name str
    The name of the Storage Container where the Blob exists.
    metadata Mapping[str, str]
    A map of custom blob metadata.
    name String
    The name of the Blob.
    storageAccountName String
    The name of the Storage Account where the Container exists.
    storageContainerName String
    The name of the Storage Container where the Blob exists.
    metadata Map<String>
    A map of custom blob metadata.

    getBlob Result

    The following output properties are available:

    AccessTier string
    The access tier of the storage blob.
    ContentMd5 string
    The MD5 sum of the blob contents.
    ContentType string
    The content type of the storage blob.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata Dictionary<string, string>
    A map of custom blob metadata.
    Name string
    StorageAccountName string
    StorageContainerName string
    Type string
    The type of the storage blob
    Url string
    The URL of the storage blob.
    AccessTier string
    The access tier of the storage blob.
    ContentMd5 string
    The MD5 sum of the blob contents.
    ContentType string
    The content type of the storage blob.
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata map[string]string
    A map of custom blob metadata.
    Name string
    StorageAccountName string
    StorageContainerName string
    Type string
    The type of the storage blob
    Url string
    The URL of the storage blob.
    accessTier String
    The access tier of the storage blob.
    contentMd5 String
    The MD5 sum of the blob contents.
    contentType String
    The content type of the storage blob.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String,String>
    A map of custom blob metadata.
    name String
    storageAccountName String
    storageContainerName String
    type String
    The type of the storage blob
    url String
    The URL of the storage blob.
    accessTier string
    The access tier of the storage blob.
    contentMd5 string
    The MD5 sum of the blob contents.
    contentType string
    The content type of the storage blob.
    id string
    The provider-assigned unique ID for this managed resource.
    metadata {[key: string]: string}
    A map of custom blob metadata.
    name string
    storageAccountName string
    storageContainerName string
    type string
    The type of the storage blob
    url string
    The URL of the storage blob.
    access_tier str
    The access tier of the storage blob.
    content_md5 str
    The MD5 sum of the blob contents.
    content_type str
    The content type of the storage blob.
    id str
    The provider-assigned unique ID for this managed resource.
    metadata Mapping[str, str]
    A map of custom blob metadata.
    name str
    storage_account_name str
    storage_container_name str
    type str
    The type of the storage blob
    url str
    The URL of the storage blob.
    accessTier String
    The access tier of the storage blob.
    contentMd5 String
    The MD5 sum of the blob contents.
    contentType String
    The content type of the storage blob.
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String>
    A map of custom blob metadata.
    name String
    storageAccountName String
    storageContainerName String
    type String
    The type of the storage blob
    url String
    The URL of the storage blob.

    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 v5.70.0 published on Wednesday, Mar 27, 2024 by Pulumi