Search⌘ K
AI Features

Connect to Azure

Explore the steps to connect your Ansible environment to Azure cloud. You will learn how to sign in using Azure CLI, create and assign roles to a service principal, configure environment variables, and verify your connection by managing Azure resources with Ansible commands.

In this lesson, you will connect your Ansible container with Azure. Following are the steps to connect to Azure:

  1. Sign in with Azure CLI.
  2. Create a Service Principal.
  3. Assign a role to the Service Principal.
  4. Create Environment Variables.
  5. Install the Azure Python module.

Prerequisites

You need to create an account on Azure. You can subscribe to Azure here.

Sign in with Azure CLI

You will use Azure CLI to create a service principal for Azure. Before you can do that, you will need a few tools to be installed and updated first. To set up Azure CLI in your development container, run the following command:

Shell
curl -sL https://aka.ms/InstallAzureCLIDeb | bash

Docker Setup
All the software packages are already installed. You can verify this by executing the az --version command in the terminal.

Once installed, run the following command:

Shell
# Verify Installation
az --version

Sign in

You will ...