Skip to content

[Az.Storage]Prompt for confirmation on long running migration operation. #27733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Storage/Storage.Autorest/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - Storage")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("8.1.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("8.1.0")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("8.4.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("8.4.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
5 changes: 5 additions & 0 deletions src/Storage/Storage.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ subject-prefix: $(service-name)
nested-object-to-string: true
identity-correction-for-post: true

# Pin to an old version to workaround a regression issue of generator. link to the issue - blabla
use-extension:
"@autorest/powershell": "4.0.734"


directive:
- from: swagger-document
where: $.paths.["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/startAccountMigration"].post.operationId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ INPUTOBJECT <IStorageIdentity>: Identity Parameter
https://learn.microsoft.com/powershell/module/az.storage/start-azstorageaccountmigration
#>
function Start-AzStorageAccountMigration {
[Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.GenericBreakingChangeAttribute("A prompt that needs users' confirmation will be added when converting the account's redundancy configuration. Suppress it with -Force.", "14.0.0", "9.0.0", "2025/05/19")]
[OutputType([System.Boolean])]
[CmdletBinding(DefaultParameterSetName='CustomerExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
Expand Down Expand Up @@ -199,11 +198,21 @@ param(
[Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')]
[System.Management.Automation.SwitchParameter]
# Use the default credentials for the proxy
${ProxyUseDefaultCredentials}
${ProxyUseDefaultCredentials},

[Parameter()]
# Forces the cmdlet to convert the account's redundancy configuration without prompting for confirmation.
[System.Management.Automation.SwitchParameter]
${Force}
)

process {
Write-Warning("After your request to convert the account's redundancy configuration is validated, the conversion will typically complete in a few days, but can take a few weeks depending on current resource demands in the region, account size, and other factors. The conversion can't be stopped after being initiated, and for accounts with geo redundancy a failover can't be initiated while conversion is in progress. The data within the storage account will continue to be accessible with no loss of durability or availability.")

if ($Force.IsPresent -or $PsCmdlet.ShouldContinue("Confirm redundancy configuration change:", "After your request to convert the account's redundancy configuration is validated, the conversion will typically complete in a few days, but can take several weeks depending on current resource demands in the region, account size, and other factors. The conversion can't be stopped after being initiated, and for accounts with geo redundancy a failover can't be initiated while conversion is in progress. The data within the storage account will continue to be accessible with no loss of durability or availability.")) {
if ($PSBoundParameters.ContainsKey("Force")) {
$PSBoundParameters.Remove("Force") | Out-Null
}
Az.Storage.internal\Start-AzStorageAccountMigration @PSBoundParameters
}
}
}
2 changes: 1 addition & 1 deletion src/Storage/Storage.Autorest/docs/Az.Storage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
Module Name: Az.Storage
Module Guid: 5d40916c-8675-46df-9847-bee3c1d8f7e2
Module Guid: 8b39ba81-b0f4-4b9c-9df6-33bdf050e6e1
Download Help Link: https://learn.microsoft.com/powershell/module/az.storage
Help Version: 1.0.0.0
Locale: en-US
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@ Zone-redundant storage (ZRS) replicates your storage account synchronously acros
### CustomerExpanded (Default)
```
Start-AzStorageAccountMigration -AccountName <String> -ResourceGroupName <String> -TargetSku <String>
[-SubscriptionId <String>] [-Name <String>] [-Type <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait]
[-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
[-SubscriptionId <String>] [-Force] [-Name <String>] [-Type <String>] [-DefaultProfile <PSObject>] [-AsJob]
[-NoWait] [-PassThru] [-Confirm] [-WhatIf] [<CommonParameters>]
```

### CustomerViaIdentityExpanded
```
Start-AzStorageAccountMigration -InputObject <IStorageIdentity> -TargetSku <String> [-Name <String>]
Start-AzStorageAccountMigration -InputObject <IStorageIdentity> -TargetSku <String> [-Force] [-Name <String>]
[-Type <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf]
[<CommonParameters>]
```

### CustomerViaJsonFilePath
```
Start-AzStorageAccountMigration -AccountName <String> -ResourceGroupName <String> -JsonFilePath <String>
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf]
[<CommonParameters>]
[-SubscriptionId <String>] [-Force] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm]
[-WhatIf] [<CommonParameters>]
```

### CustomerViaJsonString
```
Start-AzStorageAccountMigration -AccountName <String> -ResourceGroupName <String> -JsonString <String>
[-SubscriptionId <String>] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf]
[<CommonParameters>]
[-SubscriptionId <String>] [-Force] [-DefaultProfile <PSObject>] [-AsJob] [-NoWait] [-PassThru] [-Confirm]
[-WhatIf] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -132,6 +132,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Force
Forces the cmdlet to convert the account's redundancy configuration without prompting for confirmation.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:

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

### -InputObject
Identity Parameter

Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Storage.Autorest/generate-info.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"generate_Id": "c1579e62-4c75-4579-8aab-b119ed48e6eb"
"generate_Id": "2355f548-6ff6-4ef8-81a5-ed5ba38c77c0"
}
14 changes: 7 additions & 7 deletions src/Storage/Storage.Management/Az.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: Microsoft Corporation
#
# Generated on: 4/30/2025
# Generated on: 5/13/2025
#

@{
Expand Down Expand Up @@ -74,10 +74,10 @@ RequiredAssemblies = 'Azure.Data.Tables.dll', 'Azure.Storage.Blobs.dll',
'System.IO.Hashing.dll'

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = 'Storage.Autorest/Az.Storage.format.ps1xml',
Expand Down Expand Up @@ -150,7 +150,7 @@ CmdletsToExport = 'Add-AzRmStorageContainerLegalHold',
'New-AzStorageContainerSASToken',
'New-AzStorageContainerStoredAccessPolicy', 'New-AzStorageContext',
'New-AzStorageDirectory', 'New-AzStorageEncryptionScope',
'New-AzStorageFileSASToken',
'New-AzStorageFileHardLink', 'New-AzStorageFileSASToken',
'New-AzStorageLocalUserPermissionScope',
'New-AzStorageLocalUserSshPassword',
'New-AzStorageLocalUserSshPublicKey',
Expand Down Expand Up @@ -205,7 +205,7 @@ CmdletsToExport = 'Add-AzRmStorageContainerLegalHold',
'Update-AzStorageBlobServiceProperty',
'Update-AzStorageEncryptionScope',
'Update-AzStorageFileServiceProperty',
'Update-AzStorageServiceProperty', 'New-AzStorageFileHardLink'
'Update-AzStorageServiceProperty'

# Variables to export from this module
# VariablesToExport = @()
Expand All @@ -232,7 +232,7 @@ PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'Azure','ResourceManager','ARM','Storage','StorageAccount'
Tags = 'Azure', 'ResourceManager', 'ARM', 'Storage', 'StorageAccount'

# A URL to the license for this module.
LicenseUri = 'https://aka.ms/azps-license'
Expand Down Expand Up @@ -262,7 +262,7 @@ PrivateData = @{

} # End of PSData hashtable

} # End of PrivateData hashtable
} # End of PrivateData hashtable

# HelpInfo URI of this module
# HelpInfoURI = ''
Expand Down
2 changes: 2 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
* Removed MD5 from blob and file upload in some scenarios
- `Set-AzStorageFileContent`
- `Set-AzStorageBlobContent`
* Added prompt for customer confirmation for long running account migration operation .
- `Start-AzStorageAccountMigration`

## Version 8.4.0
* When create Storage context, allowed user input StorageAccountName
Expand Down
2 changes: 1 addition & 1 deletion src/Storage/Storage.Management/help/Get-AzStorageFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ It first gets the directory instance, and then pipelines it to the **Get-AzStora

### Example 3: List files and directories in a share, and exclude extended info
```powershell
Get-AzStorageFile -ShareName "ContosoShare06" -ExcludeExtendedInfo
Get-AzStorageFile -ShareName "ContosoShare06" -ExcludeExtendedInfo
```

This command lists the files and folders in under the share ContosoShare06, and exclude extended file info like timestamps, ETag, attributes, permissionKey in list file and Directory.
Expand Down
9 changes: 6 additions & 3 deletions src/Storage/Storage.Management/help/New-AzStorageContext.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Creates an Azure Storage context.
### OAuthAccount (Default)
```
New-AzStorageContext [-StorageAccountName] <String> [-UseConnectedAccount] [-Protocol <String>]
[-Endpoint <String>] [-EnableFileBackupRequestIntent] [<CommonParameters>]
[-Endpoint <String>] [-EnableFileBackupRequestIntent]
[<CommonParameters>]
```

### AccountNameAndKey
Expand Down Expand Up @@ -58,13 +59,15 @@ New-AzStorageContext [-StorageAccountName] <String> -SasToken <String> -Environm
### OAuthAccountEnvironment
```
New-AzStorageContext [-StorageAccountName] <String> [-UseConnectedAccount] [-Protocol <String>]
-Environment <String> [-EnableFileBackupRequestIntent] [<CommonParameters>]
-Environment <String> [-EnableFileBackupRequestIntent]
[<CommonParameters>]
```

### AccountNameAndKeyServiceEndpoint
```
New-AzStorageContext [-StorageAccountName] <String> [-StorageAccountKey] <String> -BlobEndpoint <String>
[-FileEndpoint <String>] [-QueueEndpoint <String>] [-TableEndpoint <String>] [<CommonParameters>]
[-FileEndpoint <String>] [-QueueEndpoint <String>] [-TableEndpoint <String>]
[<CommonParameters>]
```

### OAuthAccountServiceEndpoint
Expand Down
39 changes: 35 additions & 4 deletions src/Storage/Storage.Management/help/New-AzStorageFileHardLink.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: Microsoft.Azure.PowerShell.Cmdlets.Storage.dll-Help.xml
Module Name: Az.Storage
online version:https://learn.microsoft.com/powershell/module/az.storage/new-azstoragefilehardlink
online version: https://learn.microsoft.com/powershell/module/az.storage/new-azstoragefilehardlink
schema: 2.0.0
---

Expand All @@ -17,23 +17,24 @@ Creates a hard link to a file in same share. Only works in NFS file share.
New-AzStorageFileHardLink [-ShareName] <String> [-Path] <String> [-TargetFile] <String>
[-TargetFileLeaseId <String>] [-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>] [-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[<CommonParameters>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### Share
```
New-AzStorageFileHardLink [-ShareClient] <ShareClient> [-Path] <String> [-TargetFile] <String>
[-TargetFileLeaseId <String>] [-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>]
[-ClientTimeoutPerRequest <Int32>] [-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[<CommonParameters>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

### Directory
```
New-AzStorageFileHardLink [-ShareDirectoryClient] <ShareDirectoryClient> [-Path] <String>
[-TargetFile] <String> [-TargetFileLeaseId <String>] [-Context <IStorageContext>]
[-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>] [<CommonParameters>]
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[-WhatIf] [-Confirm] [<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -219,6 +220,36 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Confirm
Prompts you for confirmation before running the cmdlet.

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

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

```yaml
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).

Expand Down
3 changes: 2 additions & 1 deletion src/Storage/Storage.Management/help/New-AzStorageShare.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Creates a file share.
```
New-AzStorageShare [-Name] <String> [-Protocol <String>] [-EnableSnapshotVirtualDirectoryAccess <Boolean>]
[-Context <IStorageContext>] [-ServerTimeoutPerRequest <Int32>] [-ClientTimeoutPerRequest <Int32>]
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>] [<CommonParameters>]
[-DefaultProfile <IAzureContextContainer>] [-ConcurrentTaskCount <Int32>]
[<CommonParameters>]
```

## DESCRIPTION
Expand Down
Loading
Loading