Modifier

Partager via


Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration

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

Syntax

Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration
      [-ResourceGroupName] <String>
      [-StorageAccountName] <String>
      -Name <String>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Invoke-AzRmStorageContainerImmutableStorageWithVersioningMigration
      -Name <String>
      -StorageAccount <PSStorageAccount>
      [-AsJob]
      [-DefaultProfile <IAzureContextContainer>]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
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 ussually will run for a long time, you can run it asynchronously with '-Asjob'.

Parameters

-AsJob

Run cmdlet in the background

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Storage container object

Type:PSContainer
Aliases:Container
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-Name

Container Name

Type:String
Aliases:N, ContainerName
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ResourceGroupName

Resource Group Name.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StorageAccount

Storage account object

Type:PSStorageAccount
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-StorageAccountName

Storage Account Name.

Type:String
Aliases:AccountName
Position:1
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

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

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

String

PSStorageAccount

PSContainer

Outputs

PSContainer