Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.99k forks source link

"az storage account migration start" Not able to change SKU #29891

Open sid-motorq opened 1 month ago

sid-motorq commented 1 month ago

Describe the bug

According to https://learn.microsoft.com/en-us/cli/azure/storage/account/migration?view=azure-cli-latest#az-storage-account-migration-start(storage-preview), we should be able to change the target sku of the storage account. I'm not able to do it using the az cli even with the storage preview extension installed

Related command

az storage account migration start --account-name ACCOUNT_NAME --resource-group RESOURCE_GROUP --target-sku-name Standard_GRS

Errors

The behavior of this command has been altered by the following extension: storage-preview (InvalidRequestPropertyValue) The value 'Standard_GRS' is not allowed for property targetSkuName. Code: InvalidRequestPropertyValue Message: The value 'Standard_GRS' is not allowed for property targetSkuName.

Issue script & Debug output

cli.knack.cli: Command arguments: ['storage', 'account', 'migration', 'start', '--account-name', '', '--resource-group', '', '--subscription', '', '--target-sku-name', 'Standard_GRS', '--name', 'default', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x1030472e0>, <function OutputProducer.on_global_arguments at 0x1033a8720>, <function CLIQuery.on_global_arguments at 0x1033ce200>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'storage': ['azure.cli.command_modules.storage', 'azext_storage_preview'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: storage 0.321 59 274 cli.azure.cli.core: Total (1) 0.321 59 274 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.knack.cli: Event: CommandLoader.OnLoadCommandTable [] cli.azure.cli.core: storage-preview 0.027 18 62 /Users//.azure/cliextensions/storage-preview cli.azure.cli.core: Total (1) 0.027 18 62 cli.azure.cli.core: Loaded 66 groups, 298 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : storage account migration start cli.azure.cli.core: Command table: storage account migration start cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x1046216c0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/***/.azure/commands/2024-09-11.17-26-45.storage_account_migration_start.3149.log'. az_command_data_logger: command args: storage account migration start --account-name {} --resource-group {} --subscription {} --target-sku-name {} --name {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x104657240>] cli.knack.cli: Event: CommandLoader.OnLoadArguments [] cli.azure.cli.core.profiles._shared: Traceback (most recent call last): File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/profiles/_shared.py", line 660, in _get_attr op = getattr(op, part) ^^^^^^^^^^^^^^^^^ AttributeError: module 'azext_storage_preview.vendored_sdks.azure_mgmt_storage.v2023_05_01.models' has no attribute 'ActiveDirectoryPropertiesAccountType'

cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x104672840>, <function register_cache_arguments..add_cache_arguments at 0x104672980>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x104672a20>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x1033a87c0>, <function CLIQuery.handle_query_parameter at 0x1033ce2a0>, <function register_ids_argument..parse_ids_arguments at 0x1046728e0>] az_command_data_logger: extension name: storage-preview az_command_data_logger: extension version: 1.0.0b4 cli.azure.cli.core.commands: The behavior of this command has been altered by the following extension: storage-preview cli.azure.cli.core.auth.persistence: build_persistence: location='/Users//.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /Users//.azure/msal_http_cache.bin urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861 msal.authority: openid_config("https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/a1ddbffb-9d64-4305-b9a9-231850a0a861/kerberos', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'} msal.application: Broker enabled? None cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://management.core.windows.net//.default',), kwargs={} cli.azure.cli.core.auth.msal_authentication: UserCredential.get_token: scopes=('https://management.core.windows.net//.default',), claims=None, kwargs={} msal.application: Cache hit an AT msal.telemetry: Generate or reuse correlation_id: ccec712e-d8a5-4fa5-ac06-79917c401e41 cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/0d7b6080-d6a0-4fa8-ba46-6339beac9753/resourceGroups/***/providers/Microsoft.Storage/storageAccounts/***/startAccountMigration?api-version=2023-01-01' cli.azure.cli.core.sdk.policies: Request method: 'POST' cli.azure.cli.core.sdk.policies: Request headers: cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Content-Length': '68' cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'eb00ea8e-7034-11ef-8278-3e990af8f150' cli.azure.cli.core.sdk.policies: 'CommandName': 'storage account migration start' cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--account-name --resource-group --subscription --target-sku-name --name --debug' cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.64.0 (HOMEBREW) azsdk-python-core/1.28.0 Python/3.11.9 (macOS-14.5-arm64-arm-64bit)' cli.azure.cli.core.sdk.policies: 'Authorization': '**' cli.azure.cli.core.sdk.policies: Request body: cli.azure.cli.core.sdk.policies: {"name": "default", "properties": {"targetSkuName": "Standard_GRS"}} urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "POST /subscriptions/0d7b6080-d6a0-4fa8-ba46-6339beac9753/resourceGroups//providers/Microsoft.Storage/storageAccounts//startAccountMigration?api-version=2023-01-01 HTTP/1.1" 400 128 cli.azure.cli.core.sdk.policies: Response status: 400 cli.azure.cli.core.sdk.policies: Response headers: cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache' cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache' cli.azure.cli.core.sdk.policies: 'Content-Length': '128' cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json' cli.azure.cli.core.sdk.policies: 'Expires': '-1' cli.azure.cli.core.sdk.policies: 'x-ms-request-id': 'ac30cb6f-d81c-4e11-87c4-ec9c3401939f' cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-writes': '399' cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-global-writes': '5999' cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '329e4fe9-dde9-404b-a158-5abb6f3aded0' cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTINDIA:20240911T115646Z:329e4fe9-dde9-404b-a158-5abb6f3aded0' cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff' cli.azure.cli.core.sdk.policies: 'X-Cache': 'CONFIG_NOCACHE' cli.azure.cli.core.sdk.policies: 'X-MSEdge-Ref': 'Ref A: 5A89800FFB1446E586AC8AF90BF35EC8 Ref B: MAA201060513037 Ref C: 2024-09-11T11:56:46Z' cli.azure.cli.core.sdk.policies: 'Date': 'Wed, 11 Sep 2024 11:56:46 GMT' cli.azure.cli.core.sdk.policies: Response content: cli.azure.cli.core.sdk.policies: {"error":{"code":"InvalidRequestPropertyValue","message":"The value 'Standard_GRS' is not allowed for property targetSkuName."}} cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 666, in execute raise ex File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 733, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 714, in _run_job result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 1075, in call raise exception File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 1062, in call result = poller.result() ^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 108, in result self.wait(timeout) File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/core/tracing/decorator.py", line 76, in wrapper_use_tracer return func(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 130, in wait raise self._exception File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_poller.py", line 83, in _start for polling_method in self._polling_generator: File "/Users//.azure/cliextensions/storage-preview/azext_storage_preview/aaz/latest/storage/account/migration/_start.py", line 91, in _execute_operations yield self.StorageAccountsCustomerInitiatedMigration(ctx=self.ctx)() ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users//.azure/cliextensions/storage-preview/azext_storage_preview/aaz/latest/storage/account/migration/_start.py", line 127, in call return self.on_error(session.http_response) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/core/aaz/_operation.py", line 332, in on_error raise HttpResponseError(response=response, error_format=error_format) azure.core.exceptions.HttpResponseError: (InvalidRequestPropertyValue) The value 'Standard_GRS' is not allowed for property targetSkuName. Code: InvalidRequestPropertyValue Message: The value 'Standard_GRS' is not allowed for property targetSkuName.

cli.azure.cli.core.azclierror: (InvalidRequestPropertyValue) The value 'Standard_GRS' is not allowed for property targetSkuName. Code: InvalidRequestPropertyValue Message: The value 'Standard_GRS' is not allowed for property targetSkuName. az_command_data_logger: (InvalidRequestPropertyValue) The value 'Standard_GRS' is not allowed for property targetSkuName. Code: InvalidRequestPropertyValue Message: The value 'Standard_GRS' is not allowed for property targetSkuName. cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x104621940>] az_command_data_logger: exit code: 1 cli.main: Command ran in 1.827 seconds (init: 0.177, invoke: 1.650) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 4256 in cache file under /Users//.azure/telemetry/20240911172647213 telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.64.0/libexec/lib/python3.11/site-packages/azure/cli/telemetry/init.py /Users//.azure /Users/***/.azure/telemetry/20240911172647213" telemetry.process: Return from creating process 3263 telemetry.main: Finish creating telemetry upload process.

Expected behavior

We should be able to switch sku from Standard_RAGRS to Standard_GRS

Environment Summary

azure-cli 2.64.0

core 2.64.0 telemetry 1.1.0

Extensions: cosmosdb-preview 1.0.0 storage-preview 1.0.0b4

Dependencies: msal 1.30.0 azure-mgmt-resource 23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.64.0/libexec/bin/python' Extensions directory '/Users/***/.azure/cliextensions'

Python (Darwin) 3.11.9 (main, Apr 2 2024, 08:25:04) [Clang 15.0.0 (clang-1500.3.9.4)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

yonzhan commented 1 month ago

Thank you for opening this issue, we will look into it.