Upravit

Sdílet prostřednictvím


Start-AzStorageAccountMigration

Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.

Syntax

Start-AzStorageAccountMigration
     -AccountName <String>
     -ResourceGroupName <String>
     [-SubscriptionId <String>]
     -TargetSku <String>
     [-Name <String>]
     [-Type <String>]
     [-DefaultProfile <PSObject>]
     [-AsJob]
     [-NoWait]
     [-PassThru]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzStorageAccountMigration
     -AccountName <String>
     -ResourceGroupName <String>
     [-SubscriptionId <String>]
     -JsonString <String>
     [-DefaultProfile <PSObject>]
     [-AsJob]
     [-NoWait]
     [-PassThru]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzStorageAccountMigration
     -AccountName <String>
     -ResourceGroupName <String>
     [-SubscriptionId <String>]
     -JsonFilePath <String>
     [-DefaultProfile <PSObject>]
     [-AsJob]
     [-NoWait]
     [-PassThru]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]
Start-AzStorageAccountMigration
     -InputObject <IStorageIdentity>
     -TargetSku <String>
     [-Name <String>]
     [-Type <String>]
     [-DefaultProfile <PSObject>]
     [-AsJob]
     [-NoWait]
     [-PassThru]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

Account Migration request can be triggered for a storage account to change its redundancy level. The migration updates the non-zonal redundant storage account to a zonal redundant account or vice-versa in order to have better reliability and availability. Zone-redundant storage (ZRS) replicates your storage account synchronously across three Azure availability zones in the primary region.

Examples

Example 1: Start a Storage account migration

Start-AzStorageAccountMigration -AccountName myaccount -ResourceGroupName myresourcegroup -TargetSku Standard_LRS -Name migration1 -AsJob

This command starts a migration to Standard_LRS for Storage account myaccount under resource group myresourcegroup.

Example 2: Start a Storage account migration by pipeline

Get-AzStorageAccount -ResourceGroupName myresourcegroup -Name myaccount | Start-AzStorageAccountMigration  -TargetSku Standard_LRS -AsJob

The first command gets a Storage account Id, and then the second command starts a migration to Standard_LRS for Storage account myaccount under resource group myresourcegroup.

Example 3: Start a Storage account migration with Json string input

$properties = '{
   "properties": {
     "targetSkuName": "Standard_ZRS"
   }
}'
 Start-AzStorageAccountMigration -ResourceGroupName myresourcegroup -AccountName myaccount -JsonString $properties -AsJob

This command starts a Storage account migration by inputting the TargetSkuName property with a Json string.

Example 4: Start a Storage account migration with a Json file path input

# Before executing the cmdlet, make sure you have a json file that contains {"properties": {"targetSkuName": <TargetSKU>}} 
Start-AzStorageAccountMigration -ResourceGroupName myresourcegroup -AccountName myaccount -JsonFilePath properties.json -AsJob

This command starts a Storage account migration by inputting the TargetSkuName property with a Json file path.

Parameters

-AccountName

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

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

-AsJob

Run the command as a job

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 DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

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

-JsonFilePath

Path of Json file supplied to the Customer operation

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

-JsonString

Json string supplied to the Customer operation

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

-Name

current value is 'default' for customer initiated migration

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

-NoWait

Run the command asynchronously

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

-PassThru

Returns true when the command succeeds

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

-ResourceGroupName

The name of the resource group within the user's subscription. The name is case insensitive.

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

-SubscriptionId

The ID of the target subscription.

Type:String
Position:Named
Default value:(Get-AzContext).Subscription.Id
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-TargetSku

Target sku name for the account

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

-Type

SrpAccountMigrationType in ARM contract which is 'accountMigrations'

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
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

IStorageIdentity

Outputs

Boolean