az storage account create command does not find subscription from login #29215
Labels
Account
az login/account
ARM
az resource/group/lock/tag/deployment/policy/managementapp/account management-group
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
I am doing the AZ204 learn training and logged in azure using the cli from vscode.
az login is successfull and subscription is listed and I choose it. Resourcegroup mentions is as well present.
However, the az storage create command indicates an error that subscription cannot be found. This seems to be buggy or the training descriptions is wrong.
Related command
az storage account create --resource-group az204-blob-rg --name weusto-az204 --location westeurope --sku Standard_LRS
Errors
(SubscriptionNotFound) Subscription a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8 was not found.
Code: SubscriptionNotFound
Message: Subscription a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8 was not found.
Issue script & Debug output
az login --tenant d16c6208-ab49-40b4-ab22-6b4407627e17
Please select the account you want to log in with.
Retrieving subscriptions for the selection...
[Tenant and subscription selection]
No Subscription name Subscription ID Tenant
[1] * Azure PS Test Lab a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8 d16c6208-ab49-40b4-ab22-6b4407627e17
The default is marked with an *; the default tenant is 'd16c6208-ab49-40b4-ab22-6b4407627e17' and subscription is 'Azure PS Test Lab' (a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8).
Select a subscription and tenant (Type a number or Enter for no changes):
Tenant: d16c6208-ab49-40b4-ab22-6b4407627e17
Subscription: Azure PS Test Lab (a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8)
[Announcements]
With the new Azure CLI login experience, you can select the subscription you want to use more easily. Learn more about it and its configuration at https://go.microsoft.com/fwlink/?linkid=2271236
If you encounter any problem, please open an issue at https://aka.ms/azclibug
[Warning] The login output has been updated. Please be aware that it no longer displays the full list of available subscriptions by default.
(base) PS C:\Users\PeterSi> az group list
[
{
"id": "/subscriptions/a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8/resourceGroups/az204-blob-rg",
"location": "westeurope",
"managedBy": null,
"name": "az204-blob-rg",
"properties": {
"provisioningState": "Succeeded"
},
"tags": null,
"type": "Microsoft.Resources/resourceGroups"
}
]
(base) PS C:\Users\PeterSi> az storage account create --resource-group az204-blob-rg --name weusto-az204 --location westeurope --sku Standard_LRS
D:\a_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\cryptography/hazmat/backends/openssl/backend.py:17: UserWarning: You are using cryptography on a 32-bit Python on a 64-bit Windows Operating System. Cryptography will be significantly faster if you switch to using a 64-bit Python.
(SubscriptionNotFound) Subscription a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8 was not found.
Code: SubscriptionNotFound
Message: Subscription a023957f-0045-4ab4-8ffd-2f5d7ec1e0f8 was not found.
Expected behavior
Storage account is created under the related resource group under mentioned subscription
Environment Summary
(base) PS C:\Users\PeterSi> az --version
azure-cli 2.61.0
core 2.61.0
telemetry 1.1.0
Extensions:
azure-devops 0.26.0
bastion 0.2.4
Dependencies:
msal 1.28.0
azure-mgmt-resource 23.1.1
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\PeterSi.azure\cliextensions'
Python (Windows) 3.11.8 (tags/v3.11.8:db85d51, Feb 6 2024, 21:52:07) [MSC v.1937 32 bit (Intel)]
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: