Storage Account Creation using Azure CLI - SubscriptionNotFound #30550
Labels
Auto-Assign
Auto assign by bot
Azure CLI Team
The command of the issue is owned by Azure CLI team
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Storage
az storage
Milestone
Describe the bug
When creating new storage account with the following command line, resulting
error code: SubscriptionNotFound
az storage account create --resource-group az204-blob-rg --name my-storage-acct --location westus3 --sku Standard_LRS
My subscription is recently upgraded to pay-as-you-go from free account.
Related command
az storage account create --resource-group az204-blob-rg --name my-storage-acct --location westus3 --sku Standard_LRS --debug
Errors
(SubscriptionNotFound) Subscription ID was not found.
Code: SubscriptionNotFound
Message: Subscription ID was not found.
Issue script & Debug output
cli.knack.cli: Command arguments: ['storage', 'account', 'create', '--resource-group', 'az204-blob-rg', '--name', 'my-storage', '--location', 'westus3', '--sku', 'Standard_LRS', '--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 0x100faf2e0>, <function OutputProducer.on_global_arguments at 0x10116bec0>, <function CLIQuery.on_global_arguments at 0x1011ad6c0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'storage': ['azure.cli.command_modules.storage']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: storage 0.124 59 273
cli.azure.cli.core: Total (1) 0.124 59 273
cli.azure.cli.core: Loaded 59 groups, 273 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : storage account create
cli.azure.cli.core: Command table: storage account create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x1025623e0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/33er1/.azure/commands/2024-12-19.12-55-52.storage_account_create.72797.log'.
az_command_data_logger: command args: storage account create --resource-group {} --name {} --location {} --sku {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x102593f60>]
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 656, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_05_01.models' has no attribute 'ActiveDirectoryPropertiesAccountType'
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 656, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_05_01.models' has no attribute 'ListKeyExpand'
cli.azure.cli.core.profiles._shared: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/profiles/_shared.py", line 656, in _get_attr
op = getattr(op, part)
^^^^^^^^^^^^^^^^^
AttributeError: module 'azure.mgmt.storage.v2023_05_01.models' has no attribute 'CorsRuleAllowedMethodsItem'
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x1025ce2a0>, <function register_cache_arguments..add_cache_arguments at 0x1025ce3e0>, <function register_upcoming_breaking_change_info..update_breaking_change_info at 0x1025ce480>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x10116bf60>, <function CLIQuery.handle_query_parameter at 0x1011ad760>, <function register_ids_argument..parse_ids_arguments at 0x1025ce340>]
cli.azure.cli.core.commands.client_factory: Getting management service client client_type=StorageManagementClient
cli.azure.cli.core.auth.persistence: build_persistence: location='/Users/33er1/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /Users/33er1/.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/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a
msal.authority: openid_config("https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/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/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/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/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/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.commands.client_factory: Getting management service client client_type=StorageManagementClient
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/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a
msal.authority: openid_config("https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/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/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/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/3e1500be-bcd1-4dd6-9eb3-72a0eb54072a/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_credentials: 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: 02af2527-6444-4039-bd18-f40ffa9f733d
cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/subscriptions/70a369ca-c096-4710-8f4e-794250877921/providers/Microsoft.Storage/checkNameAvailability?api-version=2023-05-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': '67'
cli.azure.cli.core.sdk.policies: 'Accept': 'application/json'
cli.azure.cli.core.sdk.policies: 'x-ms-client-request-id': 'a26e478e-be4b-11ef-8ba9-ea2fdcfb940b'
cli.azure.cli.core.sdk.policies: 'CommandName': 'storage account create'
cli.azure.cli.core.sdk.policies: 'ParameterSetName': '--resource-group --name --location --sku --debug'
cli.azure.cli.core.sdk.policies: 'User-Agent': 'AZURECLI/2.67.0 (HOMEBREW) azsdk-python-core/1.31.0 Python/3.12.8 (macOS-15.2-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": "bb-storage", "type": "Microsoft.Storage/storageAccounts"}
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "POST /subscriptions/70a369ca-c096-4710-8f4e-794250877921/providers/Microsoft.Storage/checkNameAvailability?api-version=2023-05-01 HTTP/1.1" 404 118
cli.azure.cli.core.sdk.policies: Response status: 404
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': '118'
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': '7b5235c4-c6b2-4da3-b74d-2524a17d2dd8'
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-reads': '249'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-global-reads': '3749'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '623a4b21-33b7-4a48-8305-6635aaf254fe'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTUS:20241219T205553Z:623a4b21-33b7-4a48-8305-6635aaf254fe'
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: 35974A931301406FA4913C8BBA93B54A Ref B: SJC211051205051 Ref C: 2024-12-19T20:55:53Z'
cli.azure.cli.core.sdk.policies: 'Date': 'Thu, 19 Dec 2024 20:55:52 GMT'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"SubscriptionNotFound","message":"Subscription xxxx69ca-c096-4710-8f4e-7942508xxxxx was not found."}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 666, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/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.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job
result = cmd_copy(params)
^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 336, in call
return self.handler(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/command_modules/storage/operations/account.py", line 87, in create_storage_account
name_is_available = scf.storage_accounts.check_name_availability(account_name_param)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/core/tracing/decorator.py", line 94, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/mgmt/storage/v2023_05_01/operations/_storage_accounts_operations.py", line 804, in check_name_availability
map_error(status_code=response.status_code, response=response, error_map=error_map)
File "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/core/exceptions.py", line 161, in map_error
raise error
azure.core.exceptions.ResourceNotFoundError: (SubscriptionNotFound) Subscription xxxx69ca-c096-4710-8f4e-7942508xxxxx was not found.
Code: SubscriptionNotFound
Message: Subscription xxxx69ca-c096-4710-8f4e-7942508xxxxx was not found.
cli.azure.cli.core.azclierror: (SubscriptionNotFound) Subscription xxxx69ca-c096-4710-8f4e-7942508xxxxx was not found.
Code: SubscriptionNotFound
Message: Subscription 70a369ca-c096-4710-8f4e-794250877921 was not found.
az_command_data_logger: (SubscriptionNotFound) Subscription xxxx69ca-c096-4710-8f4e-7942508xxxxx was not found.
Code: SubscriptionNotFound
Message: Subscription xxxx69ca-c096-4710-8f4e-7942508xxxxx was not found.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x102562660>]
az_command_data_logger: exit code: 3
cli.main: Command ran in 0.856 seconds (init: 0.131, invoke: 0.725)
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 4124 in cache file under /Users/33er1/.azure/telemetry/20241219125553639
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/bin/python /opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/lib/python3.12/site-packages/azure/cli/telemetry/init.py /Users/33er1/.azure /Users/33er1/.azure/telemetry/20241219125553639"
telemetry.process: Return from creating process 72802
telemetry.main: Finish creating telemetry upload process.
Expected behavior
It will create the storage account.
Environment Summary
azure-cli 2.67.0
core 2.67.0
telemetry 1.1.0
Dependencies:
msal 1.31.0
azure-mgmt-resource 23.1.1
Python location '/opt/homebrew/Cellar/azure-cli/2.67.0_1/libexec/bin/python'
Extensions directory '/Users/33er1/.azure/cliextensions'
Python (Darwin) 3.12.8 (main, Dec 3 2024, 18:42:41) [Clang 16.0.0 (clang-1600.0.26.4)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Additional context
No response
The text was updated successfully, but these errors were encountered: