Step 1 – Install terraform
Step 2 – Copy a followng code into new directory in file called “main.tf”
Step 3 – Create IAM user and assign Service Principal Access?
Step 4 – update main.tf with following entry
subscription_id = ""
client_id = ""
client_secret = ""
tenant_id = ""Code language: JavaScript (javascript)
Step 5 – Go inside a directory and run following command
$ terraform init
$ terraform plan
$ terraform apply
$ terraform destroyI’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services โ all in one place.
Explore Hospitals
PS D:\Devops Codes> terraform plan
Planning failed. Terraform encountered an error while generating this plan.
โท
โ Error: building account: getting authenticated object ID: listing Service Principals: ServicePrincipalsClient.BaseClient.Get(): clientCredentialsToken: received HTTP status 401 with response: {“error”:”invalid_client”,”error_description”:”AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app ’27cbb9f1-be27-49e8-aee0-7ac8e7032efd’.\r\nTrace ID: 28a73c19-bbc4-45e1-aae0-ead5ac800e00\r\nCorrelation ID: 46b12c2d-aabc-47da-b8fd-ba3498320195\r\nTimestamp: 2023-04-27 05:05:54Z”,”error_codes”:[7000215],”timestamp”:”2023-04-27 05:05:54Z”,”trace_id”:”28a73c19-bbc4-45e1-aae0-ead5ac800e00″,”correlation_id”:”46b12c2d-aabc-47da-b8fd-ba3498320195″,”error_uri”:”https://login.microsoftonline.com/error?code=7000215″}
โ
โ with provider[“registry.terraform.io/hashicorp/azurerm”],
โ on terraform.tf line 11, in provider “azurerm”:
โ 11: provider “azurerm” {
โ
โต
PS D:\Devops Codes>