Hello Team,
I’m trying to provision Azure virtual machine using Terraform Script on RHEL 9 (RedHat Linux 9) Box. I am getting the below stack authentication error highlighted on the Linux command prompt upon running terraform plan. I am to authenticate to azure cli using az login.
Error: building account: could not acquire access token to parse claims: clientCredentialsToken: received HTTP status 400 with response: {“error”:“invalid_request”,“error_description”:“AADSTS900023: Specified tenant identifier ‘var.tenant_id’ is neither a valid DNS name, nor a valid external domain.\r\nTrace ID: 46ffed66-560b-45fa-8a6d-285496f58a00\r\nCorrelation ID: 0a59adc8-67a1-4d10-8afb-e180656eee10\r\nTimestamp: 2023-04-01 21:39:56Z”,“error_codes”:[900023],“timestamp”:“2023-04-01 21:39:56Z”,“trace_id”:“46ffed66-560b-45fa-8a6d-285496f58a00”,“correlation_id”:“0a59adc8-67a1-4d10-8afb-e180656eee10”,“error_uri”:“https://login.microsoftonline.com/error?code=900023”}
│
│ with provider[“Terraform Registry”],
│ on http://main.tf line 10, in provider “azurerm”:
│ 10: provider “azurerm” {
terraform Init output:
Initializing the backend…
Initializing provider plugins…
- Reusing previous version of hashicorp/azurerm from the dependency lock file
- Using previously-installed hashicorp/azurerm v3.50.0
Terraform has been successfully initialized!
You may now begin working with Terraform. Try running “terraform plan” to see
any changes that are required for your infrastructure. All Terraform commands
should now work.
If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
I gave my Azure App Registration “RyanAPP” (“e5b62a78-db10-45f5-b147-805784ba4d62”) secrets as a reference in a terraform.tfvars file.
Also, I have the below API permissions for my app. But still, it gives an error for azure rm block.
I already raise the support case with Azure Support Team. As per their verification, all permission are correct. Could you verify from your side as well?
I attached my Project Github Link. https://github.com/rzayn19/JenkinsCICDAzure
Regards,
Rahul