question

shaileshpathak-6177 avatar image
0 Votes"
shaileshpathak-6177 asked ·

Azure CLI - Service Principal login - isn't working for me

it throws error --

No subscriptions found for <SUBSCRIPTION-ID>

azure-ad-connect
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

amanpreetsingh-msft avatar image
0 Votes"
amanpreetsingh-msft answered ·

@shaileshpathak-6177 In order to enable Azure CLI, you need to have an active subscription as it creates a storage account for this purpose. If there is no active subscription avialable, this is expected.


Please "Accept as answer" wherever the information provided helps you to help others in the community.

· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

what is meant by "active subscription"? do you have link to a docs? I'm not willing to accept your suggestion below to "use PowerShell"...

0 Votes 0 ·
showkatmir avatar image
0 Votes"
showkatmir answered ·

Hi shaileshpathak-6177, what are you trying to achieve, Could you pleaser throw some more light.

· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

All I want to login to my account through command prompt and found the query how to do it and the process. which is through service principal. But when I hit the command I get the error No Subscription found.

0 Votes 0 ·
shaileshpathak-6177 avatar image
0 Votes"
shaileshpathak-6177 answered ·

Any update?>

All I want to login to my account through command prompt and found the query how to do it and the process. which is through service principal. But when I hit the command I get the error No Subscription found.

· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

amanpreetsingh-msft avatar image
1 Vote"
amanpreetsingh-msft answered ·

@shaileshpathak-6177 You can use PowerShell for this purpose which doesn't require a subscription. Refer to the stpes here:
https://docs.microsoft.com/en-us/powershell/azure/active-directory/signing-in-service-principal?view=azureadps-2.0

If you are getting below error while trying to connect to Azure CLI via portal and you don't have a subscription this is expected and there is no workaround for this. There must be a subscription avialable.

7534-capture.jpg

As I mentioned earlier, cloud shell requires a storage account to be created in the subscription. If you don't have a subscription, you cannot deploy storage account and use Azure CLI. Below is the resource group and storage account created for Azure CLI in my case:

7503-untitled.png


Please "Accept as answer" wherever the information provided helps you to help others in the community.


capture.jpg (20.2 KiB)
untitled.png (11.8 KiB)
· Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.