Create a Service Principal
In order to access resources a Service Principal needs to be created in your Tenant.It is easiest to do this via the AZ CLI.
-
First, make sure you are logged in:
Follow the instructions to login.
-
Once logged in, your subscriptions will be returned:
-
Next, set your active subscription:
-
Then create a Service Principal for env zero to be able to query your Azure costs:
That will return the metadata for your Service Principal:
-
Assign “Cost Management Reader” role
Add the Azure cost credentials to your Organization
- Under your Organization Settings, Select the Credentials tab
- Click Add Credential
- Select the
Azure Credentials
type. - Fill in the form with the credentials from the previous steps:
Client ID
=appId
(From step 4)
Client Secret
=password
(From step 4)
Tenant ID
=tenant
(From step 4)
Subscription ID
=id
(From step 1) - Click Add
Enable cost monitoring
- Go to the Project Settings of the desired project.
- Select the Credentials tab.
- Check the appropriate cloud provider checkbox, and select the credential you created in the steps above.
- Click Save.
Data VisibilityPlease note that after the configuration of cost monitoring is complete, a redeploy to the environments is needed, and once redeployed it can take 24-48 hours for data to show, depending on the cloud provider’s cost exploration capabilities.