From 3e20aa2367107836ef87e4b28d3ff07f4583596c Mon Sep 17 00:00:00 2001 From: christinechen2 <111460530+christinechen2@users.noreply.github.com> Date: Wed, 1 Oct 2025 13:11:08 -0700 Subject: [PATCH 1/2] Learn Editor: Update Start-AzStorageAccountMigration.md --- .../help/Start-AzStorageAccountMigration.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md b/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md index e4d907a6b7e5..95e12f16bd69 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md @@ -83,6 +83,47 @@ Start-AzStorageAccountMigration -ResourceGroupName myresourcegroup -AccountName This command starts a Storage account migration by inputting the TargetSkuName property with a Json file path. +### Example 5: Start multiple Storage account migrations at once +```powershell +# Log in to Azure + Write-Host "Logging into Azure..." + Connect-AzAccount + +# Define the CSV file path + $csvFilePath = "path\to\your\input.csv" + +# Read the CSV file + Write-Host "Reading CSV file..." + $storageAccounts = Import-Csv -Path $csvFilePath + +# Iterate through each storage account in the CSV file + foreach ($account in $storageAccounts) { + $storageAccountName = $account.'storageAccount' + $resourceGroupName = $account.'resourceGroup' + $targetSku = $account.'targetSku' + + Write-Host "Processing storage account: $storageAccountName in resource group: $resourceGroupName to target SKU: $targetSku" + + # Get the storage account + $storageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName + + # Example of adding a check for the SKU + if ($storageAccount.Sku.Name -ne "Standard_LRS") { + Write-Host "Storage account $storageAccountName is not using Standard_LRS. Skipping..." + continue + } + + # Submit the storage account SKU conversion + Write-Host "Submitting storage account $storageAccountName conversion to target SKU: $targetSku..." + Start-AzStorageAccountMigration -AccountName $storageAccountName -ResourceGroupName $resourceGroupName -TargetSku $targetSku -NoWait + } +``` + +This script starts the migration for the accounts listed in a CSV file with these example columns: +storageAccount,resourceGroup,targetSku +mystorageaccount1,myresourcegroup1,Standard_ZRS +mystorageaccount2,myresourcegroup2,Standard_ZRS + ## PARAMETERS ### -AccountName From 5fe243a563fcd84dc9a00c89b923aef042428268 Mon Sep 17 00:00:00 2001 From: christinechen2 <111460530+christinechen2@users.noreply.github.com> Date: Thu, 2 Oct 2025 13:53:14 -0700 Subject: [PATCH 2/2] Update src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Storage.Management/help/Start-AzStorageAccountMigration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md b/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md index 95e12f16bd69..75c3e0fd7e7f 100644 --- a/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md +++ b/src/Storage/Storage.Management/help/Start-AzStorageAccountMigration.md @@ -108,7 +108,7 @@ This command starts a Storage account migration by inputting the TargetSkuName p $storageAccount = Get-AzStorageAccount -ResourceGroupName $resourceGroupName -Name $storageAccountName # Example of adding a check for the SKU - if ($storageAccount.Sku.Name -ne "Standard_LRS") { + if ($storageAccount.Sku.Name -ne "Standard_LRS") { Write-Host "Storage account $storageAccountName is not using Standard_LRS. Skipping..." continue }