Skip to content
This repository has been archived by the owner on Aug 16, 2022. It is now read-only.

Add tenant information for azure provider #406

Closed
shimonp21 opened this issue Jul 6, 2022 · 2 comments · Fixed by #412
Closed

Add tenant information for azure provider #406

shimonp21 opened this issue Jul 6, 2022 · 2 comments · Fixed by #412
Assignees

Comments

@shimonp21
Copy link
Contributor

Describe the resource.

We would like to be able to use cloudquery to get tenant and susbscription information.

Use Case

..

Additional context

No response

@hermanschaaf
Copy link
Member

Looks like we could use the Tenants SDK from here: https://github.com/Azure/azure-sdk-for-go/blob/main/services/subscription/mgmt/2020-09-01/subscription/tenants.go#L34

Instantiated with subscription.NewTenantsClient()

@hermanschaaf
Copy link
Member

It seems like we will need to use a different Azure SDK (armsubscriptions).

Two tickets to track regarding this:

hermanschaaf added a commit that referenced this issue Aug 1, 2022
As requested in #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 named `azure_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 the `accounts` and `subscriptions` tables. 

Tables updated in this PR:
 - `azure_account_location_paired_region` (new)
 - `azure_account_locations` (new columns)
 - `azure_subscription_subscriptions` (new columns, notably `tenant_id` and `managed_by_tenants`)
 - `azure_subscription_tenants` (new)

Closes #406
erezrokah pushed a commit to cloudquery/cloudquery that referenced this issue Aug 14, 2022
As requested in cloudquery/cq-provider-azure#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 named `azure_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 the `accounts` and `subscriptions` tables. 

Tables updated in this PR:
 - `azure_account_location_paired_region` (new)
 - `azure_account_locations` (new columns)
 - `azure_subscription_subscriptions` (new columns, notably `tenant_id` and `managed_by_tenants`)
 - `azure_subscription_tenants` (new)

Closes cloudquery/cq-provider-azure#406
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants