locked
Error with ASDK Service Principal authentication with Terraforms RRS feed

  • Question

  • Hi,

    Running into an issue with being unable to setup Service Principal authentication in my ASDK environment with my terraform deployment scripts. The guide I am using to setup my Service Principal is this one by Terraform for Azure Stack. The error I get is when I run `Terraform Apply` is as follows:

    Error: Unable to list provider registration status, it is possible that this is due to invalid credentials or the service principal does not have permission to use the Resource Manager API, Azure error: azure.BearerAuthorizer#WithAuthorization: Failed to refresh the Token for request to https://management.local.azurestack.external/subscriptions/f14df8e7-300e-439b-adff-1dfc6ede3547/providers?api-version=2016-02-01: StatusCode=400 -- Original Error: adal: Refresh request failed. Status Code = '400'. Response body: {"error":"invalid_client","error_description":"MSIS9607: The \u0027client_id\u0027 parameter in the request is invalid. No registered client is found with this identifier."}

    provider "azurestack" {
    version = ">=0.5.0"
    arm_endpoint = ""
    client_id = ""
    client_secret = ""
    subscription_id = ""
    tenant_id = ""
    }

    To me it sounds like I am not setting up the Service Principal correctly in the Azure Portal. But I following the guide exactly, so I am lost at the moment, does anyone have any other ideas on what could be causing this error to happen?

    Tuesday, May 26, 2020 10:20 PM

Answers

  • Update,

    So I got it working, the issue was the guide I was following from Terraform doesn't work with the ASDK. I ended up following the "App Identity to Access Azure Stack Hub resources" guide by Microsoft.


    Wednesday, May 27, 2020 4:27 PM

All replies

  • Can you link the Terraform for Azure Stack doc you are following? I know that Terraform has modules for Azure Stack, but I am not sure if they work with the ASDK. 
    Wednesday, May 27, 2020 7:09 AM
  • Update,

    So I got it working, the issue was the guide I was following from Terraform doesn't work with the ASDK. I ended up following the "App Identity to Access Azure Stack Hub resources" guide by Microsoft.


    Wednesday, May 27, 2020 4:27 PM
  • That is pretty interesting, do you have links or resources where you read this? It might be alot of trouble if I cannot use Terraform modules :(
    Wednesday, May 27, 2020 4:28 PM