Building Infrastructure Using Azure Resource Manager

Learn to build and clean up a stack of infrastructure using the Azure SDK for Go.

Cloud APIs are bifurcated into two categories, the management plane and the data plane. The management plane is an API that controls the creation, deletion, and mutation of infrastructure. The data plane is an API exposed by provisioned infrastructure.

For example, the management plane would be used to create a SQL database. The data plane for the SQL database resource would be the SQL protocol for manipulating data and structure within the database.

The management plane is serviced by the cloud resource API, and the data plane is serviced by the API exposed by the provisioned service.

In this lesson, we will learn how to use the Azure SDK for Go to provision infrastructure in Azure. We will learn how to create and destroy resource groups, virtual networks, subnets, public IPs, virtual machines, and databases. The goal of this section is to build awareness of the Azure Go SDK and how to interact with ARM.

Azure SDK for Go

Cloud SDKs simplify the interaction between a given language and a cloud provider's API. In the case of Azure, we will be using the Azure SDK for Go to interact with the Azure APIs. Specifically, we'll use the latest edition of the SDK, which has been redesigned to follow the Azure design guidelines for Go. For the latest information about packages and docs, be sure to check out the Azure SDK Releases page.

The code for this section is located here on GitHub.

Setting up the environment

To run the code for this section, we will need to set up a Secure Shell (SSH) key and an .env file.

Get hands-on with 1200+ tech skills courses.