Azure Account Credential Setup¶
Aviatrix Controller uses Azure APIs extensively to launch Aviatrix gateways, configure encrypted peering and other features.
In order to use Azure API, you need to first create an Aviatrix Access Account on the Aviatrix controller. This access account corresponds to a valid Azure subscription with API credentials. You need to create an access account for each subscription.
This document describes, for a given subscription, how to obtain the necessary information, specifically Application ID, Application Key (Client secret), and Application Directory ID to create an Aviatrix Access Account so that the Controller can execute APIs on that subscription. There are 3 sections, make sure you go through all of them.
2. API and Permission Setup¶
Setting up Azure permission for Aviatrix involves three main steps.
- Register Aviatrix Controller Application with Azure Active Directory
- Assign a role to the Aviatrix Controller Application
- Get Application ID, Application Key (Client secret) and Directory ID
Important: Complete the following steps in order.
2.1 – Register Aviatrix Controller Application¶
Login to the Azure Portal: https://portal.azure.com
- From the Azure portal click on “All services” and search for “Azure Active Directory” and click on “Azure Active Directory”.
- Click “App registrations”. Do not choose “App registrations (Legacy)”
- Click “+ New registration”
- Name = Aviatrix Controller
- Supported account types = Accounts in this organizational directory only
- Click Register.
2.2 – Assign a role to the Aviatrix Application¶
- Login to the Azure portal
- On the top left, click All services, search for “Subscriptions”
- Copy the Subscription ID (to notepad or a convenient location)
- Click on the Subscription ID
- Then select “Access control (IAM)”.
- Click Add and then select the “Contributor” role. If the “Contributor” role is too broad, you can later replace it with a custom role with specific permissions. Refer to Use Azure IAM Custom Role for instructions.
- In the Select search field, type in “Aviatrix”. The Aviatrix Controller (that you created in section 2.1) app should show up. Select this one and click Select towards to the bottom.
2.3 – Setup Information for Programmatic Sign in¶
From the Azure portal, click All services and search for “Azure Active Directory”. Click “App registrations” and then the application to see the Application (client) ID and Directory (tenant) ID.
Retrieve the Application (client) ID and Directory (tenant) ID.
- Copy the Application ID and Directory ID for later use.
Retrieve the Client Secrets.
- Click Certificates & secrets
- Click + New client secret
- Enter in the following, and then click Add
- Description = Aviatrix
- Expires = Never
- You should see the new secret as shown below.
- Copy the secret. This will be used as the Application Key in the Aviatrix Controller.
Add API permissions.
Go to Azure Active Directory -> select the “Aviatrix Controller” application, click into the application.
- Click API permissions
- Click “+Add a permission”
- Choose Azure Service Management
At this point you should have the following information to create an access account on Azure.
|Access Account Setup Input Field||Value|
|Subscription ID||From section 2.2|
|Directory ID||From section 2.3|
|Application ID||From section 2.3|
|Application Key (Client Secret)||From section 2.3|
If you need additional information, refer to How to: Use the portal to create an Azure AD application and service principal that can access resources on Azure documentation.