Learning DevOps
上QQ阅读APP看书,第一时间看更新

Terraform configuration for local development and testing

When you work locally and want to test the Terraform code quickly, in a sandbox environment, for example, it may be more convenient and faster to use your own Azure account instead of using an SP.

To do this, it is possible to connect to Azure beforehand with the az login command, and then enter your identification information in the window that opens. 

The following is a screenshot of the Azure login window:

If several subscriptions are accessed, the desired one can be selected with the following command:

az account set --subscription="<Subscription ID>"

Then, we configure the Terraform provider as before with the provider, "azurerm" { }.

Of course, this authentication method is not to be done in the case of execution on a remote server.

For more information on the provider configuration, refer to the documentation:  https://www.terraform.io/docs/providers/azurerm/index.html.

The Terraform configuration for Azure is, therefore, defined by the configuration of the provider that uses the information from an Azure SP.

Once this configuration is complete, we can start writing Terraform code to manage and provision Azure resources.