Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.


Get Started Now!

Terraform: Example Code for Create Multiple Azure Linux Vms


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       = ""

Step 5 – Go inside a directory and run following command


$ terraform init
$ terraform plan 
$ terraform apply 
$ terraform destroy
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments
Akhil
Akhil
1 year ago

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> 

Certification Courses

DevOpsSchool has introduced a series of professional certification courses designed to enhance your skills and expertise in cutting-edge technologies and methodologies. Whether you are aiming to excel in development, security, or operations, these certifications provide a comprehensive learning experience. Explore the following programs:

DevOps Certification, SRE Certification, and DevSecOps Certification by DevOpsSchool

Explore our DevOps Certification, SRE Certification, and DevSecOps Certification programs at DevOpsSchool. Gain the expertise needed to excel in your career with hands-on training and globally recognized certifications.

1
0
Would love your thoughts, please comment.x
()
x