Login with your Azure Credentials
- Open the Azure Portal in your web browser.
- Click on the Cloud Shell icon in the top right corner of the portal.
- If prompted, click "Bash" to launch the Azure Cloud Shell.
- The first time you launch the Cloud Shell, you will be asked to create a storage account and file share. Follow the prompts to complete this setup.
Create Storage for Azure Cloud Shell
- If you haven't already, click on the "Create storage" button when prompted in the Cloud Shell.
- Select the Azure subscription you want to use.
- Choose the region where you want to create the storage resources.
- The Cloud Shell will automatically create a new resource group, storage account, and file share for you.
Verify Terraform is Installed
- Within the Azure Cloud Shell, run the command
terraform version
. - This should output the version of Terraform that is pre-installed in the Cloud Shell environment.
Start using Terraform in the Azure Cloud Shell
- Create a new directory for your Terraform project:
mkdir terraform-project && cd terraform-project
. - Initialize a new Terraform working directory:
terraform init
. - Start building your Terraform configuration files, such as
main.tf
,variables.tf
, andoutputs.tf
. - Run
terraform plan
to preview the changes your configuration will make. - If the plan looks good, run
terraform apply
to provision the resources in Azure. - When you're done, you can run
terraform destroy
to remove the resources.