Connecting Teevity to your Azure environment
Last updated - 2024/08/05
Teevity connects to your Azure environment using the Azure Consumption API
Connection with the Teevity CLI
You can use the Teevity CLI (cf https://api.teevity.com to find the installation instructions).
Getting help on the options
teevity cloudservices declare-azure-ea --help
Azure BillingAccount declaration
# Declare an Azure BillingAccount on a Teevity Account
# The Azure Consumption Async API specific parameters are specified via the '--teevity-custom-technicaldetails' option
# - azureAsyncConsumptionTenantId
# - azureAsyncConsumptionClientId (aka applicationId/clientId in Microsoft parlance)
# - azureAsyncConsumptionClientSecret (aka clientSecret/secretKey in Microsoft parlance)
# - subscriptionIdsOptionalFilter (OPTIONAL list of subscription UUIDs, separated by ",")
teevity --key "$TEEVITY_APIKEY" cloudservices declare-account-azureea \
--azureea-api-key-expiration-date "1674907200000" \
--azureea-api-key-expiration-notification-recipient "cloudops.teevity.azure@acme.com" \
--azureea-enrollment-id "82xxxx42" \
--azureea-enrollment-name "Acme Azure Cloud" \
--azureea-api-key "NoAzureApiKeyForAzureEA" \
--teevity-custom-technicaldetails "{"azureAPIToUse":"azureConsumptionAsync", "azureAsyncConsumptionTenantId":"f35a6974xxxxxxxxxxxd7dc53a5", "azureAsyncConsumptionClientId":"21cec14a-xxxxxxxxxx30aecc50","azureAsyncConsumptionClientSecret":"x5LxxxxxxxxxxxxxxdR", "subscriptionIdsOptionalFilter":"62bd8ed9-dc33-4f56-8158-093c99fc8641,2b9ba95d-d7ec-4070-a4e1-93a4a31fd936,de50a670-dd24-4abd-afa8-e0bb87e589a3,c8a1a4a8-7648-450e-8a3a-dec932a5f082"}" \
--forceOverrideExisting \
--polling-do-not-immediately-poll-costs-for-created-or-updated-platforms
Remark:
The --polling-do-not-immediately-poll-costs-for-created-or-updated-platforms parameter is optional and is a sort of --dry-run option
The two following parameters are available but optional
monthStartUTCTimestampMillis (optional, timestampMilis)
monthEndUTCTimestampMillisOptionalFilter (optional, timestampMilis)
Credentials and permissions required for the Billing Data connection
You need to create an "Azure Application" (that you will most likely called something like "saas.finops.teevity.azureapp"
Credentials : The applicationId/clientId and clientSecret/secretKey are used to identify the "Azure Application" for the connection to Teevity.
Permissions: You need to provide the Azure Application with the following permissions:
billing-reader, management group reader and monitoring reader permission
Permissions required for the Billing Data and Metrics connection
The "Azure Application" created previously should be provided with the following Roles (ie group of permissions):
Billing Data
The billing-reader Role
The management group reader Role
Metrics
The monitoring reader Role
Here is how it looks in the Azure UI console