The way we'll get the cost forecast of your Azure subscription is by registering an application on Azure. This allows you to make REST API calls directly from the MagTag using secure credentials. To do this you'll create a Service Principal using the Azure CloudShell.

1. Log into the Azure portal

2. Click on the CloudShell icon as shown in the photo above.

If this is the first time you're using CloudShell you'll need to select a storage account to use it with.

Note: using a storage account for this project costs <$0.01 a day.

For more info on CloudShell visit this site.

3. Once the CLI loads type and run:

az ad sp create-for-rbac --name [APP_NAME]

Replace "[APP_NAME]" with a name like "cost-monitor"

4. Save Credentials

Copy the APP ID, PASSWORD, and TENANT ID and save into a secure location. We'll need this later for the MagTag's file.

5. Get Subscription ID property

Next type and run:

az account list

Again, copy and save the "id" property together with the credentials from the previous step. Label this property SUBSCRIPTION ID. We'll use it later in the file.

This guide was first published on Feb 15, 2021. It was last updated on Jul 12, 2024.

This page (Get Azure Credentials) was last updated on Mar 08, 2024.

Text editor powered by tinymce.