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 Aug 1, 2022
Merged
Conversation
bbernays
reviewed
Jul 12, 2022
bbernays
reviewed
Jul 13, 2022
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 |
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. |
bbernays
approved these changes
Jul 29, 2022
Contributor
bbernays
left a comment
There was a problem hiding this comment.
LGTM... other than 1 question
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
As requested in #406, this adds support for listing tenants under a subscription.
It can be used by adding
subscriptions.tenantto the cloudquery config, which will then populate a table namedazure_subscription_tenants.To add this, we had to start using the new
armsubscriptionsAzure 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 theaccountsandsubscriptionstables.Tables updated in this PR:
azure_account_location_paired_region(new)azure_account_locations(new columns)azure_subscription_subscriptions(new columns, notablytenant_idandmanaged_by_tenants)azure_subscription_tenants(new)Closes #406