Skip to content
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

az storage account create command does not find subscription from login #29215

Closed
psingler-planb opened this issue Jun 20, 2024 · 3 comments
Closed
Assignees
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

Comments

@psingler-planb
Copy link

psingler-planb commented Jun 20, 2024

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

@psingler-planb psingler-planb added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Storage az storage labels Jun 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 20, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jun 20, 2024

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

@microsoft-github-policy-service microsoft-github-policy-service bot added the ARM az resource/group/lock/tag/deployment/policy/managementapp/account management-group label Jun 20, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Account az login/account label Jun 20, 2024
@yonzhan yonzhan added this to the Backlog milestone Jun 20, 2024
@yonzhan yonzhan removed the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jun 20, 2024
@calvinhzy
Copy link
Member

@psingler-planb hi can you run az storage account create --resource-group az204-blob-rg --name weusto-az204 --location westeurope --sku Standard_LRS --debug to show the full debug log? Thanks.

@psingler-planb
Copy link
Author

The issue was actually that the storage was not registered as resource provider under the subscription. The learning path documentation did not indicate that. All fine now. Thx for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

6 participants