Azure ConfigurationΒΆ
Follow these steps to analyze Microsoft Azure assets with Cartography:
Set up an Azure identity for Cartography to use, and ensure that this identity has the Azure permissions needed for both subscription resources and management-group hierarchy reads:
Subscription/resource inventory: the built-in Azure Reader role on the subscriptions you want to sync
Management-group hierarchy: a management-group-scoped read role such as
Management Group Readeron the tenant root management group (or another scope broad enough to read the management groups you want to sync)Authenticate:
$ az loginCreate a Service Principal:
$ az ad sp create-for-rbac --name cartography --role ReaderNote the values of the
tenant,appId, andpasswordfields
If you are using a Service Principal, also assign it read access to the management-group hierarchy. For example, grant
Management Group Readerat theTenant Root Groupso Cartography can read management groups and subscription placement within that hierarchy.Populate environment variables with the values generated in the previous step (e.g.,
AZURE_TENANT_ID,AZURE_CLIENT_ID,AZURE_CLIENT_SECRET)Call the
cartographyCLI with:--azure-sp-auth --azure-sync-all-subscriptions \ --azure-tenant-id ${AZURE_TENANT_ID} \ --azure-client-id ${AZURE_CLIENT_ID} \ --azure-client-secret-env-var AZURE_CLIENT_SECRET