We recommend using Azure Native.
Azure v6.28.0 published on Friday, Oct 3, 2025 by Pulumi
azure.storage.getBlob
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/v6/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)
public static Output<GetBlobResult> getBlob(GetBlobArgs args, InvokeOptions options)
fn::invoke:
function: azure:storage/getBlob:getBlob
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Blob.
- Storage
Account stringName - The name of the Storage Account where the Container exists.
- Storage
Container stringName - 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.
- Storage
Account stringName - The name of the Storage Account where the Container exists.
- Storage
Container stringName - 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.
- storage
Account StringName - The name of the Storage Account where the Container exists.
- storage
Container StringName - 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.
- storage
Account stringName - The name of the Storage Account where the Container exists.
- storage
Container stringName - 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_ strname - The name of the Storage Account where the Container exists.
- storage_
container_ strname - 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.
- storage
Account StringName - The name of the Storage Account where the Container exists.
- storage
Container StringName - 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:
- Access
Tier string - The access tier of the storage blob.
- Content
Md5 string - The MD5 sum of the blob contents.
- Content
Type string - The content type of the storage blob.
- Encryption
Scope string - The encryption scope for this blob.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata Dictionary<string, string>
- A map of custom blob metadata.
- Name string
- Storage
Account stringName - Storage
Container stringName - Type string
- The type of the storage blob
- Url string
- The URL of the storage blob.
- Access
Tier string - The access tier of the storage blob.
- Content
Md5 string - The MD5 sum of the blob contents.
- Content
Type string - The content type of the storage blob.
- Encryption
Scope string - The encryption scope for this blob.
- Id string
- The provider-assigned unique ID for this managed resource.
- Metadata map[string]string
- A map of custom blob metadata.
- Name string
- Storage
Account stringName - Storage
Container stringName - Type string
- The type of the storage blob
- Url string
- The URL of the storage blob.
- access
Tier String - The access tier of the storage blob.
- content
Md5 String - The MD5 sum of the blob contents.
- content
Type String - The content type of the storage blob.
- encryption
Scope String - The encryption scope for this blob.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<String,String>
- A map of custom blob metadata.
- name String
- storage
Account StringName - storage
Container StringName - type String
- The type of the storage blob
- url String
- The URL of the storage blob.
- access
Tier string - The access tier of the storage blob.
- content
Md5 string - The MD5 sum of the blob contents.
- content
Type string - The content type of the storage blob.
- encryption
Scope string - The encryption scope for this blob.
- id string
- The provider-assigned unique ID for this managed resource.
- metadata {[key: string]: string}
- A map of custom blob metadata.
- name string
- storage
Account stringName - storage
Container stringName - 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.
- encryption_
scope str - The encryption scope for this 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_ strname - storage_
container_ strname - type str
- The type of the storage blob
- url str
- The URL of the storage blob.
- access
Tier String - The access tier of the storage blob.
- content
Md5 String - The MD5 sum of the blob contents.
- content
Type String - The content type of the storage blob.
- encryption
Scope String - The encryption scope for this blob.
- id String
- The provider-assigned unique ID for this managed resource.
- metadata Map<String>
- A map of custom blob metadata.
- name String
- storage
Account StringName - storage
Container StringName - 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
azurermTerraform Provider.
