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

feat: Add support for Tenants#412

Merged
hermanschaaf merged 18 commits intocloudquery:mainfrom
hermanschaaf:tenants
Aug 1, 2022
Merged

feat: Add support for Tenants#412
hermanschaaf merged 18 commits intocloudquery:mainfrom
hermanschaaf:tenants

Conversation

@hermanschaaf
Copy link
Copy Markdown
Contributor

@hermanschaaf hermanschaaf commented Jul 12, 2022

Summary

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

@hermanschaaf hermanschaaf requested review from a team and candiduslynx and removed request for a team July 12, 2022 13:00
@hermanschaaf hermanschaaf marked this pull request as draft July 19, 2022 11:26
@hermanschaaf
Copy link
Copy Markdown
Contributor Author

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). Azure/azure-sdk-for-go#18620 and Azure/azure-sdk-for-go#18619

@hermanschaaf hermanschaaf marked this pull request as ready for review July 29, 2022 14:10
@hermanschaaf
Copy link
Copy Markdown
Contributor Author

@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.

Copy link
Copy Markdown
Contributor

@bbernays bbernays left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM... other than 1 question

@hermanschaaf hermanschaaf merged commit 940af7f into cloudquery:main Aug 1, 2022
kodiakhq bot pushed a commit that referenced this pull request Aug 7, 2022
🤖 I have created a release *beep* *boop*
---


## [0.12.3](v0.12.2...v0.12.3) (2022-08-07)


### Features

* Add support for Tenants ([#412](#412)) ([940af7f](940af7f))


### Bug Fixes

* **deps:** Update module github.com/Azure/go-autorest/autorest to v0.11.28 ([#443](#443)) ([bc87594](bc87594))
* **deps:** Update module github.com/cloudquery/cq-gen to v0.0.7 ([#453](#453)) ([361d908](361d908))
* **deps:** Update module github.com/cloudquery/cq-gen to v0.0.8 ([#457](#457)) ([7d61851](7d61851))
* **deps:** Update module github.com/hashicorp/go-hclog to v1.2.2 ([#444](#444)) ([6c769c9](6c769c9))
* **deps:** Update tubone24/update_release digest to 2146f15 ([#389](#389)) ([e5682fd](e5682fd))
* **docs:** Some minor docs fixes ([#454](#454)) ([6feb015](6feb015))
* **tests:** Remove terraform for Azure ExpressRoute port ([#440](#440)) ([7413740](7413740))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
erezrokah pushed a commit to cloudquery/cloudquery that referenced this pull request Aug 14, 2022
🤖 I have created a release *beep* *boop*
---


## [0.12.3](cloudquery/cq-provider-azure@v0.12.2...v0.12.3) (2022-08-07)


### Features

* Add support for Tenants ([#412](cloudquery/cq-provider-azure#412)) ([940af7f](cloudquery/cq-provider-azure@940af7f))


### Bug Fixes

* **deps:** Update module github.com/Azure/go-autorest/autorest to v0.11.28 ([#443](cloudquery/cq-provider-azure#443)) ([bc87594](cloudquery/cq-provider-azure@bc87594))
* **deps:** Update module github.com/cloudquery/cq-gen to v0.0.7 ([#453](cloudquery/cq-provider-azure#453)) ([361d908](cloudquery/cq-provider-azure@361d908))
* **deps:** Update module github.com/cloudquery/cq-gen to v0.0.8 ([#457](cloudquery/cq-provider-azure#457)) ([7d61851](cloudquery/cq-provider-azure@7d61851))
* **deps:** Update module github.com/hashicorp/go-hclog to v1.2.2 ([#444](cloudquery/cq-provider-azure#444)) ([6c769c9](cloudquery/cq-provider-azure@6c769c9))
* **deps:** Update tubone24/update_release digest to 2146f15 ([#389](cloudquery/cq-provider-azure#389)) ([e5682fd](cloudquery/cq-provider-azure@e5682fd))
* **docs:** Some minor docs fixes ([#454](cloudquery/cq-provider-azure#454)) ([6feb015](cloudquery/cq-provider-azure@6feb015))
* **tests:** Remove terraform for Azure ExpressRoute port ([#440](cloudquery/cq-provider-azure#440)) ([7413740](cloudquery/cq-provider-azure@7413740))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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 this pull request may close these issues.

Add tenant information for azure provider

2 participants