locked
Unable to connect to Azure Stack PowerShell RRS feed

  • Question

  • Hello,

    When trying to connect to PowerShell using this command,

    Add-AzureRmEnvironment -Name 'Azure Stack' `
        -ActiveDirectoryEndpoint ("https://login.windows.net/$AadTenantId/") `
        -ActiveDirectoryServiceEndpointResourceId "https://azurestack.local-api/" `
        -ResourceManagerEndpoint ("https://api.azurestack.local/") `
        -GalleryEndpoint ("https://gallery.azurestack.local:30016/") `
        -GraphEndpoint "https://graph.windows.net/"

    I get the following error

    Add-AzureRmAccount : AADSTS50001: The application named https://azurestack.local-api/ was not found in the tenant named 30045722-3388-450f-b067-23a307460e04.  This can 
    happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant.  You might have sent your authentication 
    request to the wrong tenant.

    I have tried this on 2 installations of the POC. any help would be appreciated.

    Thanks,


    If this post answered your question, Mark As Answer If this post was helpful, Vote as Helpful ---------------------------------------------------------- http://lyncme.blogspot.com

    Wednesday, July 6, 2016 2:15 AM

Answers

  • Thanks for your response,

    I found the issue - when authenticating it was using the wrong directory. I had to specify the GUID of the correct directory i specified during POC setup.

    Found the correct GUID by logging into manage.windowsazure.com and opening the directory via Active Directory and copied the GUID from the address URL.


    If this post answered your question, Mark As Answer If this post was helpful, Vote as Helpful ---------------------------------------------------------- http://lyncme.blogspot.com

    • Marked as answer by Tim_MCP Wednesday, July 6, 2016 12:35 PM
    Wednesday, July 6, 2016 12:35 PM

All replies

  • Hello,

    Thank you for posting here!

    Before you are trying to connect to PowerShell using above command, please provide AAD tenant ID.

    # Add the Microsoft Azure Stack environment
    
            $AadTenantId="DIRECTORY_TENANT_NAME"
    
    # Configure the environment with the Add-AzureRmEnvironment cmdlet
            Add-AzureRmEnvironment -Name 'Azure Stack' `
                -ActiveDirectoryEndpoint "https://login.windows.net/$AadTenantId/" `
                -ActiveDirectoryServiceEndpointResourceId "https://azurestack.local-api/"`
                -ResourceManagerEndpoint "https://api.azurestack.local/" `
                -GalleryEndpoint "https://gallery.azurestack.local/" `
                -GraphEndpoint "https://graph.windows.net/"
    
            # Authenticate a user to the environment (you will be prompted during authentication)
            $privateEnv = Get-AzureRmEnvironment 'Azure Stack'
            $privateAzure = Add-AzureRmAccount -Environment $privateEnv -Verbose
            Select-AzureRmProfile -Profile $privateAzure
    
            # Select an existing subscription where the deployment will take place
            Get-AzureRmSubscription -SubscriptionName "SUBSCRIPTION_NAME"  | Select-AzureRmSubscription
    

    For more information, kindly refer the link given below:

    https://azure.microsoft.com/en-us/documentation/articles/azure-stack-deploy-template-powershell/#authenticate-powershell-with-microsoft-azure-stack-required

     

    Regards,

    Pradeep

    Wednesday, July 6, 2016 10:22 AM
  • Thanks for your response,

    I found the issue - when authenticating it was using the wrong directory. I had to specify the GUID of the correct directory i specified during POC setup.

    Found the correct GUID by logging into manage.windowsazure.com and opening the directory via Active Directory and copied the GUID from the address URL.


    If this post answered your question, Mark As Answer If this post was helpful, Vote as Helpful ---------------------------------------------------------- http://lyncme.blogspot.com

    • Marked as answer by Tim_MCP Wednesday, July 6, 2016 12:35 PM
    Wednesday, July 6, 2016 12:35 PM