Edit

Share via


Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration

Migrate an existing Storage blob containers to enable immutable Storage with versioning.

Syntax

AccountName (Default)

Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration
    [-ResourceGroupName] <String>
    [-StorageAccountName] <String>
    -Name <String>
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

AccountObject

Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration
    -Name <String>
    -StorageAccount <PSStorageAccount>
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

ContainerObject

Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration
    -InputObject <PSContainer>
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

The Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration cmdlet migrates an existing Storage blob containers to enable immutable Storage with versioning. The cmdlet only works when the Storage account has already enabled blob versioning, and the containers already has ImmutabilityPolicy.

Examples

Example 1: Migrates an existing Storage blob containers to enable immutable Storage with versioning.

$t = Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration -ResourceGroupName "myResourceGroup" -AccountName "mystorageaccount" -Name testcontainer -asjob

$t | Wait-Job

This command migrates an existing Storage blob containers to enable immutable Storage with versioning. The command only works when the Storage account has already enabled blob versioning, and the containers already has ImmutabilityPolicy. Since the command usually will run for a long time, you can run it asynchronously with '-Asjob'.

Parameters

-AsJob

Run cmdlet in the background

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Storage container object

Parameter properties

Type:PSContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:Container

Parameter sets

ContainerObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-Name

Container Name

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:N, ContainerName

Parameter sets

AccountName
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False
AccountObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceGroupName

Resource Group Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AccountName
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-StorageAccount

Storage account object

Parameter properties

Type:PSStorageAccount
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

AccountObject
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

-StorageAccountName

Storage Account Name.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AccountName

Parameter sets

AccountName
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

PSStorageAccount

PSContainer

Outputs

PSContainer