Closed hermanschaaf closed 2 years ago
After a lot of digging, I discovered that the Azure Go SDK doesn't provide all the fields that the API does, including Tenant ID per subscription. Before we continue with this, I think it would be good to hear back from Microsoft to see if they are willing to add this functionality (or would allow me to add it). https://github.com/Azure/azure-sdk-for-go/issues/18620 and https://github.com/Azure/azure-sdk-for-go/issues/18619
@bbernays This is now ready for another look - I've updated it to use the new Azure SDKs, which introduces a few new columns and tables and supports a way to link subscriptions with tenants.
Summary
As requested in https://github.com/cloudquery/cq-provider-azure/issues/406, this adds support for listing tenants under a subscription.
It can be used by adding
subscriptions.tenant
to the cloudquery config, which will then populate a table namedazure_subscription_tenants
.To add this, we had to start using the new
armsubscriptions
Azure SDK, which requires Go 1.18 and uses generics. The implementation for the subscriptions client has been switched to use this now. The benefit of this is that we also get new columns and relations on theaccounts
andsubscriptions
tables.Tables updated in this PR:
azure_account_location_paired_region
(new)azure_account_locations
(new columns)azure_subscription_subscriptions
(new columns, notablytenant_id
andmanaged_by_tenants
)azure_subscription_tenants
(new)Closes https://github.com/cloudquery/cq-provider-azure/issues/406