1. Packages
  2. Azure Classic
  3. API Docs
  4. backup
  5. ContainerStorageAccount

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi
azure logo

We recommend using Azure Native.

Viewing docs for Azure v4.42.0 (Older version)
published on Monday, Mar 9, 2026 by Pulumi

    Manages registration of a storage account with Azure Backup. Storage accounts must be registered with an Azure Recovery Vault in order to backup file shares within the storage account. Registering a storage account with a vault creates what is known as a protection container within Azure Recovery Services. Once the container is created, Azure file shares within the storage account can be backed up using the azure.backup.ProtectedFileShare resource.

    NOTE: Azure Backup for Azure File Shares is currently in public preview. During the preview, the service is subject to additional limitations and unsupported backup scenarios. Read More

    Example Usage

    using Pulumi;
    using Azure = Pulumi.Azure;
    
    class MyStack : Stack
    {
        public MyStack()
        {
            var rg = new Azure.Core.ResourceGroup("rg", new Azure.Core.ResourceGroupArgs
            {
                Location = "West Europe",
            });
            var vault = new Azure.RecoveryServices.Vault("vault", new Azure.RecoveryServices.VaultArgs
            {
                Location = rg.Location,
                ResourceGroupName = rg.Name,
                Sku = "Standard",
            });
            var sa = new Azure.Storage.Account("sa", new Azure.Storage.AccountArgs
            {
                Location = rg.Location,
                ResourceGroupName = rg.Name,
                AccountTier = "Standard",
                AccountReplicationType = "LRS",
            });
            var container = new Azure.Backup.ContainerStorageAccount("container", new Azure.Backup.ContainerStorageAccountArgs
            {
                ResourceGroupName = rg.Name,
                RecoveryVaultName = vault.Name,
                StorageAccountId = sa.Id,
            });
        }
    
    }
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/backup"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/core"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/recoveryservices"
    	"github.com/pulumi/pulumi-azure/sdk/v4/go/azure/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		rg, err := core.NewResourceGroup(ctx, "rg", &core.ResourceGroupArgs{
    			Location: pulumi.String("West Europe"),
    		})
    		if err != nil {
    			return err
    		}
    		vault, err := recoveryservices.NewVault(ctx, "vault", &recoveryservices.VaultArgs{
    			Location:          rg.Location,
    			ResourceGroupName: rg.Name,
    			Sku:               pulumi.String("Standard"),
    		})
    		if err != nil {
    			return err
    		}
    		sa, err := storage.NewAccount(ctx, "sa", &storage.AccountArgs{
    			Location:               rg.Location,
    			ResourceGroupName:      rg.Name,
    			AccountTier:            pulumi.String("Standard"),
    			AccountReplicationType: pulumi.String("LRS"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = backup.NewContainerStorageAccount(ctx, "container", &backup.ContainerStorageAccountArgs{
    			ResourceGroupName: rg.Name,
    			RecoveryVaultName: vault.Name,
    			StorageAccountId:  sa.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    import * as pulumi from "@pulumi/pulumi";
    import * as azure from "@pulumi/azure";
    
    const rg = new azure.core.ResourceGroup("rg", {location: "West Europe"});
    const vault = new azure.recoveryservices.Vault("vault", {
        location: rg.location,
        resourceGroupName: rg.name,
        sku: "Standard",
    });
    const sa = new azure.storage.Account("sa", {
        location: rg.location,
        resourceGroupName: rg.name,
        accountTier: "Standard",
        accountReplicationType: "LRS",
    });
    const container = new azure.backup.ContainerStorageAccount("container", {
        resourceGroupName: rg.name,
        recoveryVaultName: vault.name,
        storageAccountId: sa.id,
    });
    
    import pulumi
    import pulumi_azure as azure
    
    rg = azure.core.ResourceGroup("rg", location="West Europe")
    vault = azure.recoveryservices.Vault("vault",
        location=rg.location,
        resource_group_name=rg.name,
        sku="Standard")
    sa = azure.storage.Account("sa",
        location=rg.location,
        resource_group_name=rg.name,
        account_tier="Standard",
        account_replication_type="LRS")
    container = azure.backup.ContainerStorageAccount("container",
        resource_group_name=rg.name,
        recovery_vault_name=vault.name,
        storage_account_id=sa.id)
    

    Example coming soon!

    Create ContainerStorageAccount Resource

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

    Constructor syntax

    new ContainerStorageAccount(name: string, args: ContainerStorageAccountArgs, opts?: CustomResourceOptions);
    @overload
    def ContainerStorageAccount(resource_name: str,
                                args: ContainerStorageAccountArgs,
                                opts: Optional[ResourceOptions] = None)
    
    @overload
    def ContainerStorageAccount(resource_name: str,
                                opts: Optional[ResourceOptions] = None,
                                recovery_vault_name: Optional[str] = None,
                                resource_group_name: Optional[str] = None,
                                storage_account_id: Optional[str] = None)
    func NewContainerStorageAccount(ctx *Context, name string, args ContainerStorageAccountArgs, opts ...ResourceOption) (*ContainerStorageAccount, error)
    public ContainerStorageAccount(string name, ContainerStorageAccountArgs args, CustomResourceOptions? opts = null)
    public ContainerStorageAccount(String name, ContainerStorageAccountArgs args)
    public ContainerStorageAccount(String name, ContainerStorageAccountArgs args, CustomResourceOptions options)
    
    type: azure:backup:ContainerStorageAccount
    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 ContainerStorageAccountArgs
    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 ContainerStorageAccountArgs
    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 ContainerStorageAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ContainerStorageAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ContainerStorageAccountArgs
    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 containerStorageAccountResource = new Azure.Backup.ContainerStorageAccount("containerStorageAccountResource", new()
    {
        RecoveryVaultName = "string",
        ResourceGroupName = "string",
        StorageAccountId = "string",
    });
    
    example, err := backup.NewContainerStorageAccount(ctx, "containerStorageAccountResource", &backup.ContainerStorageAccountArgs{
    	RecoveryVaultName: pulumi.String("string"),
    	ResourceGroupName: pulumi.String("string"),
    	StorageAccountId:  pulumi.String("string"),
    })
    
    var containerStorageAccountResource = new ContainerStorageAccount("containerStorageAccountResource", ContainerStorageAccountArgs.builder()
        .recoveryVaultName("string")
        .resourceGroupName("string")
        .storageAccountId("string")
        .build());
    
    container_storage_account_resource = azure.backup.ContainerStorageAccount("containerStorageAccountResource",
        recovery_vault_name="string",
        resource_group_name="string",
        storage_account_id="string")
    
    const containerStorageAccountResource = new azure.backup.ContainerStorageAccount("containerStorageAccountResource", {
        recoveryVaultName: "string",
        resourceGroupName: "string",
        storageAccountId: "string",
    });
    
    type: azure:backup:ContainerStorageAccount
    properties:
        recoveryVaultName: string
        resourceGroupName: string
        storageAccountId: string
    

    ContainerStorageAccount 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 ContainerStorageAccount resource accepts the following input properties:

    RecoveryVaultName string
    The name of the vault where the storage account will be registered.
    ResourceGroupName string
    Name of the resource group where the vault is located.
    StorageAccountId string
    The ID of the Storage Account to be registered
    RecoveryVaultName string
    The name of the vault where the storage account will be registered.
    ResourceGroupName string
    Name of the resource group where the vault is located.
    StorageAccountId string
    The ID of the Storage Account to be registered
    recoveryVaultName String
    The name of the vault where the storage account will be registered.
    resourceGroupName String
    Name of the resource group where the vault is located.
    storageAccountId String
    The ID of the Storage Account to be registered
    recoveryVaultName string
    The name of the vault where the storage account will be registered.
    resourceGroupName string
    Name of the resource group where the vault is located.
    storageAccountId string
    The ID of the Storage Account to be registered
    recovery_vault_name str
    The name of the vault where the storage account will be registered.
    resource_group_name str
    Name of the resource group where the vault is located.
    storage_account_id str
    The ID of the Storage Account to be registered
    recoveryVaultName String
    The name of the vault where the storage account will be registered.
    resourceGroupName String
    Name of the resource group where the vault is located.
    storageAccountId String
    The ID of the Storage Account to be registered

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ContainerStorageAccount Resource

    Get an existing ContainerStorageAccount 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?: ContainerStorageAccountState, opts?: CustomResourceOptions): ContainerStorageAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            recovery_vault_name: Optional[str] = None,
            resource_group_name: Optional[str] = None,
            storage_account_id: Optional[str] = None) -> ContainerStorageAccount
    func GetContainerStorageAccount(ctx *Context, name string, id IDInput, state *ContainerStorageAccountState, opts ...ResourceOption) (*ContainerStorageAccount, error)
    public static ContainerStorageAccount Get(string name, Input<string> id, ContainerStorageAccountState? state, CustomResourceOptions? opts = null)
    public static ContainerStorageAccount get(String name, Output<String> id, ContainerStorageAccountState state, CustomResourceOptions options)
    resources:  _:    type: azure:backup:ContainerStorageAccount    get:      id: ${id}
    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:
    RecoveryVaultName string
    The name of the vault where the storage account will be registered.
    ResourceGroupName string
    Name of the resource group where the vault is located.
    StorageAccountId string
    The ID of the Storage Account to be registered
    RecoveryVaultName string
    The name of the vault where the storage account will be registered.
    ResourceGroupName string
    Name of the resource group where the vault is located.
    StorageAccountId string
    The ID of the Storage Account to be registered
    recoveryVaultName String
    The name of the vault where the storage account will be registered.
    resourceGroupName String
    Name of the resource group where the vault is located.
    storageAccountId String
    The ID of the Storage Account to be registered
    recoveryVaultName string
    The name of the vault where the storage account will be registered.
    resourceGroupName string
    Name of the resource group where the vault is located.
    storageAccountId string
    The ID of the Storage Account to be registered
    recovery_vault_name str
    The name of the vault where the storage account will be registered.
    resource_group_name str
    Name of the resource group where the vault is located.
    storage_account_id str
    The ID of the Storage Account to be registered
    recoveryVaultName String
    The name of the vault where the storage account will be registered.
    resourceGroupName String
    Name of the resource group where the vault is located.
    storageAccountId String
    The ID of the Storage Account to be registered

    Import

    Backup Storage Account Containers can be imported using the resource id, e.g.

     $ pulumi import azure:backup/containerStorageAccount:ContainerStorageAccount mycontainer "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource-group-name/providers/Microsoft.RecoveryServices/vaults/recovery-vault-name/backupFabrics/Azure/protectionContainers/StorageContainer;storage;storage-rg-name;storage-account"
    

    Note the ID requires quoting as there are semicolons

    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.

    Viewing docs for Azure v4.42.0 (Older version)
    published on Monday, Mar 9, 2026 by Pulumi
      Try Pulumi Cloud free. Your team will thank you.