42 lines
1.7 KiB
Markdown
42 lines
1.7 KiB
Markdown
# Azure Authentication ✔️
|
|
|
|
For the Azure Resource Manager the fastest way to get started is by having access to the azure-cli tool. We only need this once.
|
|
|
|
1. Execute `az login` and follow the instructions to log in using a browser.
|
|
|
|

|
|

|
|

|
|
|
|
2. From the output of the command, take note of the tentantId value.
|
|
|
|

|
|
|
|
3. After running `az account list` take note of the id value.
|
|
|
|

|
|
|
|
4. Create a new application with `az ad app create --display-name "AppName"`
|
|
|
|
5. With `az ad app list --display-name AppName` take note of the appId
|
|
|
|

|
|
|
|
6. Create a new service principal with `az ad sp create --id appId`
|
|
|
|
7. Get an id value from `az ad sp list --display-name AppName` to create a new role with `az role assignment create --assignee "id we got just now" --role Owner --scope /subscriptions/sub id we got`
|
|
|
|

|
|
|
|
8. Head over to https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationMenuBlade/~/Credentials/appId/appId we got/defaultBlade/AppRoles and create a new client secret to be used in for the authentication.
|
|
|
|
The values we need translate to the following:
|
|
|
|
* AZURE_TENANT_ID -> tentantId
|
|
* AZURE_SUB_ID -> id from step 3
|
|
* AZURE_APP_ID -> appId
|
|
* AZURE_PASSWORD -> value of the secret we added
|
|
|
|
Note: Make sure your subscription is registered to use at least Microsoft.Compute and Microsoft.Network.
|
|
From the subscriptions page and resource providers tab.
|