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

shailesh pathak 1 Reputation point
2020-04-14T23:39:41.857+00:00

it throws error --

No subscriptions found for <SUBSCRIPTION-ID>

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
19,100 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Cory Shike 26 Reputation points
    2021-08-27T15:09:22.423+00:00

    Use the --allow-no-subscriptions switch to get past the error and log in this is what I needed to do to connect to DevOps to create repos etc.

    az login --allow-no-subscriptions
    
    4 people found this answer helpful.

  2. AmanpreetSingh-MSFT 56,286 Reputation points
    2020-04-17T15:47:07.17+00:00

    @shailesh pathak You can use PowerShell for this purpose which doesn't require a subscription. Refer to the stpes here:
    https://learn.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.

    1 person found this answer helpful.
    0 comments No comments

  3. AmanpreetSingh-MSFT 56,286 Reputation points
    2020-04-15T07:42:27.707+00:00

    @shailesh pathak 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.


  4. showkatmir 1 Reputation point
    2020-04-15T15:13:46.637+00:00

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


  5. shailesh pathak 1 Reputation point
    2020-04-17T14:32:19.35+00:00

    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.

    0 comments No comments