-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Dom Clayton edited this page Feb 17, 2022
·
15 revisions
# Login using Azure CLI
az login
# What is the default subscription?
az account show -o table
# List Subscriptions
az account list -o table
# Set subscription
az account set --subscription="SubscriptionId"Terraform state contains all resources Terraform knows about in your particular environment. To show the current state use:
terraform state list -state="/home/path/to/the/state/file"
for example
terraform state list -state="/home/domc/mysource/Terraform/OpenVPN/Learning/terraform.tfstate"
NOTE Messed up state by running Terraform init, then removing code which initialised a provider...use
terraform state rm -state="/home/path/to/the/state/file" state address
for example
terraform state rm -state="/home/domc/mysource/Terraform/OpenVPN/Learning/terraform.tfstate data.http.myIp"
terraform import -state="/home/path/to/the/state/file" resourcetype.resourcename application_id
for example
terraform import -state=/home/domc/mysource/Terraform/vNetGateway/Test/terraform.tfstate azuread_application.AzureVPN 00000000-0000-0000-0000-000000000000