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

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

azure.storage.getStorageContainer

Explore with Pulumi AI

azure logo

We recommend using Azure Native.

Azure v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi

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

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const example = azure.storage.getAccount({
        name: "exampleaccount",
        resourceGroupName: "examples",
    });
    const exampleGetStorageContainer = example.then(example => azure.storage.getStorageContainer({
        name: "example-container-name",
        storageAccountId: example.id,
    }));
    
    import pulumi
    import pulumi_azure as azure
    
    example = azure.storage.get_account(name="exampleaccount",
        resource_group_name="examples")
    example_get_storage_container = azure.storage.get_storage_container(name="example-container-name",
        storage_account_id=example.id)
    
    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 {
    		example, err := storage.LookupAccount(ctx, &storage.LookupAccountArgs{
    			Name:              "exampleaccount",
    			ResourceGroupName: pulumi.StringRef("examples"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = storage.GetStorageContainer(ctx, &storage.GetStorageContainerArgs{
    			Name:             "example-container-name",
    			StorageAccountId: pulumi.StringRef(example.Id),
    		}, 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.GetAccount.Invoke(new()
        {
            Name = "exampleaccount",
            ResourceGroupName = "examples",
        });
    
        var exampleGetStorageContainer = Azure.Storage.GetStorageContainer.Invoke(new()
        {
            Name = "example-container-name",
            StorageAccountId = example.Apply(getAccountResult => getAccountResult.Id),
        });
    
    });
    
    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.GetAccountArgs;
    import com.pulumi.azure.storage.inputs.GetStorageContainerArgs;
    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.getAccount(GetAccountArgs.builder()
                .name("exampleaccount")
                .resourceGroupName("examples")
                .build());
    
            final var exampleGetStorageContainer = StorageFunctions.getStorageContainer(GetStorageContainerArgs.builder()
                .name("example-container-name")
                .storageAccountId(example.applyValue(getAccountResult -> getAccountResult.id()))
                .build());
    
        }
    }
    
    variables:
      example:
        fn::invoke:
          Function: azure:storage:getAccount
          Arguments:
            name: exampleaccount
            resourceGroupName: examples
      exampleGetStorageContainer:
        fn::invoke:
          Function: azure:storage:getStorageContainer
          Arguments:
            name: example-container-name
            storageAccountId: ${example.id}
    

    Using getStorageContainer

    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 getStorageContainer(args: GetStorageContainerArgs, opts?: InvokeOptions): Promise<GetStorageContainerResult>
    function getStorageContainerOutput(args: GetStorageContainerOutputArgs, opts?: InvokeOptions): Output<GetStorageContainerResult>
    def get_storage_container(metadata: Optional[Mapping[str, str]] = None,
                              name: Optional[str] = None,
                              storage_account_id: Optional[str] = None,
                              storage_account_name: Optional[str] = None,
                              opts: Optional[InvokeOptions] = None) -> GetStorageContainerResult
    def get_storage_container_output(metadata: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                              name: Optional[pulumi.Input[str]] = None,
                              storage_account_id: Optional[pulumi.Input[str]] = None,
                              storage_account_name: Optional[pulumi.Input[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetStorageContainerResult]
    func GetStorageContainer(ctx *Context, args *GetStorageContainerArgs, opts ...InvokeOption) (*GetStorageContainerResult, error)
    func GetStorageContainerOutput(ctx *Context, args *GetStorageContainerOutputArgs, opts ...InvokeOption) GetStorageContainerResultOutput

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

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

    The following arguments are supported:

    Name string
    The name of the Container.
    Metadata Dictionary<string, string>
    A mapping of MetaData for this Container.
    StorageAccountId string

    The name of the Storage Account where the Container exists. This property will become Required in version 5.0 of the Provider.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    StorageAccountName string
    The name of the Storage Account where the Container exists. This property is deprecated in favour of storage_account_id.
    Name string
    The name of the Container.
    Metadata map[string]string
    A mapping of MetaData for this Container.
    StorageAccountId string

    The name of the Storage Account where the Container exists. This property will become Required in version 5.0 of the Provider.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    StorageAccountName string
    The name of the Storage Account where the Container exists. This property is deprecated in favour of storage_account_id.
    name String
    The name of the Container.
    metadata Map<String,String>
    A mapping of MetaData for this Container.
    storageAccountId String

    The name of the Storage Account where the Container exists. This property will become Required in version 5.0 of the Provider.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storageAccountName String
    The name of the Storage Account where the Container exists. This property is deprecated in favour of storage_account_id.
    name string
    The name of the Container.
    metadata {[key: string]: string}
    A mapping of MetaData for this Container.
    storageAccountId string

    The name of the Storage Account where the Container exists. This property will become Required in version 5.0 of the Provider.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storageAccountName string
    The name of the Storage Account where the Container exists. This property is deprecated in favour of storage_account_id.
    name str
    The name of the Container.
    metadata Mapping[str, str]
    A mapping of MetaData for this Container.
    storage_account_id str

    The name of the Storage Account where the Container exists. This property will become Required in version 5.0 of the Provider.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storage_account_name str
    The name of the Storage Account where the Container exists. This property is deprecated in favour of storage_account_id.
    name String
    The name of the Container.
    metadata Map<String>
    A mapping of MetaData for this Container.
    storageAccountId String

    The name of the Storage Account where the Container exists. This property will become Required in version 5.0 of the Provider.

    NOTE: One of storage_account_name or storage_account_id must be specified. When specifying storage_account_id the resource will use the Resource Manager API, rather than the Data Plane API.

    storageAccountName String
    The name of the Storage Account where the Container exists. This property is deprecated in favour of storage_account_id.

    getStorageContainer Result

    The following output properties are available:

    ContainerAccessType string
    The Access Level configured for this Container.
    DefaultEncryptionScope string
    The default encryption scope in use for blobs uploaded to this container.
    EncryptionScopeOverrideEnabled bool
    Whether blobs are allowed to override the default encryption scope for this container.
    HasImmutabilityPolicy bool
    Is there an Immutability Policy configured on this Storage Container?
    HasLegalHold bool
    Is there a Legal Hold configured on this Storage Container?
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata Dictionary<string, string>
    A mapping of MetaData for this Container.
    Name string
    ResourceManagerId string

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    StorageAccountId string
    StorageAccountName string
    ContainerAccessType string
    The Access Level configured for this Container.
    DefaultEncryptionScope string
    The default encryption scope in use for blobs uploaded to this container.
    EncryptionScopeOverrideEnabled bool
    Whether blobs are allowed to override the default encryption scope for this container.
    HasImmutabilityPolicy bool
    Is there an Immutability Policy configured on this Storage Container?
    HasLegalHold bool
    Is there a Legal Hold configured on this Storage Container?
    Id string
    The provider-assigned unique ID for this managed resource.
    Metadata map[string]string
    A mapping of MetaData for this Container.
    Name string
    ResourceManagerId string

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    StorageAccountId string
    StorageAccountName string
    containerAccessType String
    The Access Level configured for this Container.
    defaultEncryptionScope String
    The default encryption scope in use for blobs uploaded to this container.
    encryptionScopeOverrideEnabled Boolean
    Whether blobs are allowed to override the default encryption scope for this container.
    hasImmutabilityPolicy Boolean
    Is there an Immutability Policy configured on this Storage Container?
    hasLegalHold Boolean
    Is there a Legal Hold configured on this Storage Container?
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String,String>
    A mapping of MetaData for this Container.
    name String
    resourceManagerId String

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    storageAccountId String
    storageAccountName String
    containerAccessType string
    The Access Level configured for this Container.
    defaultEncryptionScope string
    The default encryption scope in use for blobs uploaded to this container.
    encryptionScopeOverrideEnabled boolean
    Whether blobs are allowed to override the default encryption scope for this container.
    hasImmutabilityPolicy boolean
    Is there an Immutability Policy configured on this Storage Container?
    hasLegalHold boolean
    Is there a Legal Hold configured on this Storage Container?
    id string
    The provider-assigned unique ID for this managed resource.
    metadata {[key: string]: string}
    A mapping of MetaData for this Container.
    name string
    resourceManagerId string

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    storageAccountId string
    storageAccountName string
    container_access_type str
    The Access Level configured for this Container.
    default_encryption_scope str
    The default encryption scope in use for blobs uploaded to this container.
    encryption_scope_override_enabled bool
    Whether blobs are allowed to override the default encryption scope for this container.
    has_immutability_policy bool
    Is there an Immutability Policy configured on this Storage Container?
    has_legal_hold bool
    Is there a Legal Hold configured on this Storage Container?
    id str
    The provider-assigned unique ID for this managed resource.
    metadata Mapping[str, str]
    A mapping of MetaData for this Container.
    name str
    resource_manager_id str

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    storage_account_id str
    storage_account_name str
    containerAccessType String
    The Access Level configured for this Container.
    defaultEncryptionScope String
    The default encryption scope in use for blobs uploaded to this container.
    encryptionScopeOverrideEnabled Boolean
    Whether blobs are allowed to override the default encryption scope for this container.
    hasImmutabilityPolicy Boolean
    Is there an Immutability Policy configured on this Storage Container?
    hasLegalHold Boolean
    Is there a Legal Hold configured on this Storage Container?
    id String
    The provider-assigned unique ID for this managed resource.
    metadata Map<String>
    A mapping of MetaData for this Container.
    name String
    resourceManagerId String

    Deprecated: this property has been deprecated in favour of id and will be removed in version 5.0 of the Provider.

    storageAccountId String
    storageAccountName String

    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 v6.10.0 published on Tuesday, Nov 19, 2024 by Pulumi