Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add table azure_management_group. Closes #456 #460

Merged
merged 11 commits into from
Apr 5, 2022
Merged

Add table azure_management_group. Closes #456 #460

merged 11 commits into from
Apr 5, 2022

Conversation

bigdatasourav
Copy link
Contributor

@bigdatasourav bigdatasourav commented Apr 1, 2022

Integration test logs

Logs
The integration test is not feasible.

Example query results

Results
> select
  id,
  name,
  type,
  tenant_id,
  updated_by
from
  azure_management_group;
+---------------------------------------------------------------------------+--------------------------+---------------------------------------+--------------------------------------+---------------------
| id                                                                        | name                     | type                                  | tenant_id                            | updated_by          
+---------------------------------------------------------------------------+--------------------------+---------------------------------------+--------------------------------------+---------------------
| /providers/Microsoft.Management/managementGroups/morales                  | morales                  | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | d00ae2b0-6317-4fc3-a
| /providers/Microsoft.Management/managementGroups/nagraj                   | nagraj                   | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | d00ae2b0-6317-4fc3-a
| /providers/Microsoft.Management/managementGroups/osborn                   | osborn                   | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | d00ae2b0-6317-4fc3-a
| /providers/Microsoft.Management/managementGroups/newwarriors              | newwarriors              | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | 2f617226-8962-431e-9
| /providers/Microsoft.Management/managementGroups/stacy                    | stacy                    | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | d00ae2b0-6317-4fc3-a
| /providers/Microsoft.Management/managementGroups/daredevil                | daredevil                | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | d00ae2b0-6317-4fc3-a
| /providers/Microsoft.Management/managementGroups/newwarrior-child-mgmtgrp | newwarrior-child-mgmtgrp | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | 2f617226-8962-431e-9
| /providers/Microsoft.Management/managementGroups/parker                   | parker                   | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | d00ae2b0-6317-4fc3-a
| /providers/Microsoft.Management/managementGroups/Punisher                 | Punisher                 | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | 2f617226-8962-431e-9
| /providers/Microsoft.Management/managementGroups/turbot-dev-saas          | turbot-dev-saas          | Microsoft.Management/managementGroups | cdffd708-7da0-4cea-abeb-0a4c334d7f64 | d00ae2b0-6317-4fc3-a
+---------------------------------------------------------------------------+--------------------------+---------------------------------------+--------------------------------------+---------------------


select
	name,
  updated_by,
	jsonb_pretty(children) as children
from
	azure_management_group;
+--------------------------+--------------------------------------+--------------------------------------------------------------------------------------------+
| name                     | updated_by                           | children                                                                                   |
+--------------------------+--------------------------------------+--------------------------------------------------------------------------------------------+
| morales                  | d00ae2b0-6317-4fc3-a828-31fca920448f | [                                                                                          |
|                          |                                      |     {                                                                                      |
|                          |                                      |         "id": "/subscriptions/236a078d-0292-46be-80a3-cd8a1cbccde0",                       |
|                          |                                      |         "name": "236a078d-0292-46be-80a3-cd8a1cbccde0",                                    |
|                          |                                      |         "type": "/subscriptions",                                                          |
|                          |                                      |         "displayName": "morales AAA"                                                       |
|                          |                                      |     }                                                                                      |
|                          |                                      | ]                                                                                          |
| nagraj                   | d00ae2b0-6317-4fc3-a828-31fca920448f | [                                                                                          |
|                          |                                      |     {                                                                                      |
|                          |                                      |         "id": "/subscriptions/d077e537-71c8-4d6e-ae26-56019ef569e2",                       |
|                          |                                      |         "name": "d077e537-71c8-4d6e-ae26-56019ef569e2",                                    |
|                          |                                      |         "type": "/subscriptions",                                                          |
|                          |                                      |         "displayName": "Nagraj AAA"                                                        |
|                          |                                      |     }                                                                                      |
|                          |                                      | ]                                                                                          |
| osborn                   | d00ae2b0-6317-4fc3-a828-31fca920448f | [                                                                                          |
|                          |                                      |     {                                                                                      |
|                          |                                      |         "id": "/subscriptions/ed4b87de-70f6-4d3e-8a37-fe8452c231ea",                       |
|                          |                                      |         "name": "ed4b87de-70f6-4d3e-8a37-fe8452c231ea",                                    |
|                          |                                      |         "type": "/subscriptions",                                                          |
|                          |                                      |         "displayName": "Bulbasaur AAA"                                                     |
|                          |                                      |     }                                                                                      |

@bigdatasourav bigdatasourav self-assigned this Apr 1, 2022
@bigdatasourav bigdatasourav changed the title Add table azure_management_group Add table azure_management_group. Closes #456 Apr 1, 2022
@bigdatasourav bigdatasourav linked an issue Apr 1, 2022 that may be closed by this pull request
@bigdatasourav bigdatasourav requested a review from ParthaI April 5, 2022 05:45
Copy link
Contributor

@ParthaI ParthaI left a comment

Choose a reason for hiding this comment

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

LGTM

}

// check if name is empty
if name == ""{
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if name == ""{
if name == "" {


// check if name is empty
if name == ""{
return nil,nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return nil,nil
return nil,nil


Management groups provide a governance scope above subscriptions. You organize subscriptions into management groups in the governance conditions you apply cascade by inheritance to all associated subscriptions. Management groups give you enterprise-grade management at a scale no matter what type of subscriptions you might have. However, all subscriptions within a single management group must trust the same Azure Active Directory (Azure AD) tenant.

Note: To query this table, you need to have read access to the specific management group.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Note: To query this table, you need to have read access to the specific management group.
Note: To query this table, you need to have at least read access to the specific management group.

azure_management_group;
```

### List parent detail for management groups
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
### List parent detail for management groups
### List parent details for management groups

@misraved misraved merged commit 1f0ed92 into main Apr 5, 2022
@misraved misraved deleted the issue-456 branch April 5, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table azure_management_group
3 participants