-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Resource Graph: adding param to extend query result with subscription and tenant names #9469
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
6b4919f
Include subscription Name to result
92d35c2
Tests added
e879731
Improving initialization logic
06f2125
Merge branch 'master' of https://github.com/Azure/azure-powershell in…
2ebcbc1
Extend with tenants
0bce24f
Update ChangeLog.md
08dfa44
fixing bug
c58350a
Deleted extra dependency
1e83b16
Applying feedback
93137c9
send one request to "/tenants" once per session
04f48a5
Resolving merge conflict:
77ff276
Merge branch 'master' of https://github.com/Azure/azure-powershell in…
bb53037
using ARM tenants client
143fd61
simplifying logic
6ecfbdf
updated version for subscriptioncache
f7463ff
Merge branch 'master' into AddName
cormacpayne 103e7de
Update ChangeLog.md
cormacpayne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
197 changes: 197 additions & 0 deletions
197
...ds.ResourceGraph.Test.ScenarioTests.ResourceGraphQueryTests/InlcudeSubscriptionNames.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,197 @@ | ||
| { | ||
| "Entries": [ | ||
| { | ||
| "RequestUri": "/subscriptions?api-version=2016-06-01", | ||
| "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNi0wNi0wMQ==", | ||
| "RequestMethod": "GET", | ||
| "RequestBody": "", | ||
| "RequestHeaders": { | ||
| "x-ms-client-request-id": [ | ||
| "31537677-7032-4654-becb-372f2eeebf21" | ||
| ], | ||
| "accept-language": [ | ||
| "en-US" | ||
| ], | ||
| "User-Agent": [ | ||
| "FxVersion/4.7.3163.0", | ||
| "OSName/Windows10Enterprise", | ||
| "OSVersion/6.3.17134", | ||
| "Microsoft.Azure.Internal.Subscriptions.SubscriptionClient/4.1.0" | ||
| ] | ||
| }, | ||
| "ResponseBody": "{\"value\": [{\"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000\", \"subscriptionId\": \"00000000-0000-0000-0000-000000000000\", \"displayName\": \"Test Subscription\", \"state\": \"Enabled\", \"authorizationSource\": \"RoleBased\"}]}", | ||
| "ResponseHeaders": { | ||
| "Content-Length": [ | ||
| "987" | ||
| ], | ||
| "Content-Type": [ | ||
| "application/json; charset=utf-8" | ||
| ], | ||
| "Expires": [ | ||
| "-1" | ||
| ], | ||
| "Pragma": [ | ||
| "no-cache" | ||
| ], | ||
| "x-ms-ratelimit-remaining-tenant-reads": [ | ||
| "11999" | ||
| ], | ||
| "x-ms-request-id": [ | ||
| "dc5b4ea5-4059-44fa-9d49-5c48f46224f4" | ||
| ], | ||
| "x-ms-correlation-request-id": [ | ||
| "dc5b4ea5-4059-44fa-9d49-5c48f46224f4" | ||
| ], | ||
| "x-ms-routing-request-id": [ | ||
| "WESTUS2:20180926T232942Z:dc5b4ea5-4059-44fa-9d49-5c48f46224f4" | ||
| ], | ||
| "Strict-Transport-Security": [ | ||
| "max-age=31536000; includeSubDomains" | ||
| ], | ||
| "X-Content-Type-Options": [ | ||
| "nosniff" | ||
| ], | ||
| "Cache-Control": [ | ||
| "no-cache" | ||
| ], | ||
| "Date": [ | ||
| "Wed, 26 Sep 2018 23:29:41 GMT" | ||
| ] | ||
| }, | ||
| "StatusCode": 200 | ||
| }, | ||
| { | ||
| "RequestUri": "/tenants?api-version=2019-05-10", | ||
| "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnM/YXBpLXZlcnNpb249MjAxNi0wNi0wMQ==", | ||
| "RequestMethod": "GET", | ||
| "RequestBody": "", | ||
| "RequestHeaders": { | ||
| "x-ms-client-request-id": [ | ||
| "31537677-7032-4654-becb-372f2eeebf21" | ||
| ], | ||
| "accept-language": [ | ||
| "en-US" | ||
| ], | ||
| "User-Agent": [ | ||
| "FxVersion/4.7.3163.0", | ||
| "OSName/Windows10Enterprise", | ||
| "OSVersion/6.3.17134", | ||
| "Microsoft.Azure.Internal.Subscriptions.SubscriptionClient/4.1.0" | ||
| ] | ||
| }, | ||
| "ResponseBody": "{\"value\":[{\"id\":\"/tenants/00000000-0000-0000-0000-000000000000\",\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"countryCode\":\"US\",\"displayName\":\"Test Tenant\",\"domains\":[],\"tenantCategory\":\"test\"}]}\"", | ||
| "ResponseHeaders": { | ||
| "Content-Length": [ | ||
| "987" | ||
| ], | ||
| "Content-Type": [ | ||
| "application/json; charset=utf-8" | ||
| ], | ||
| "Expires": [ | ||
| "-1" | ||
| ], | ||
| "Pragma": [ | ||
| "no-cache" | ||
| ], | ||
| "x-ms-ratelimit-remaining-tenant-reads": [ | ||
| "11999" | ||
| ], | ||
| "x-ms-request-id": [ | ||
| "dc5b4ea5-4059-44fa-9d49-5c48f46224f4" | ||
| ], | ||
| "x-ms-correlation-request-id": [ | ||
| "dc5b4ea5-4059-44fa-9d49-5c48f46224f4" | ||
| ], | ||
| "x-ms-routing-request-id": [ | ||
| "WESTUS2:20180926T232942Z:dc5b4ea5-4059-44fa-9d49-5c48f46224f4" | ||
| ], | ||
| "Strict-Transport-Security": [ | ||
| "max-age=31536000; includeSubDomains" | ||
| ], | ||
| "X-Content-Type-Options": [ | ||
| "nosniff" | ||
| ], | ||
| "Cache-Control": [ | ||
| "no-cache" | ||
| ], | ||
| "Date": [ | ||
| "Wed, 26 Sep 2018 23:29:41 GMT" | ||
| ] | ||
| }, | ||
| "StatusCode": 200 | ||
| }, | ||
| { | ||
| "RequestUri": "/providers/Microsoft.ResourceGraph/resources?api-version=2018-09-01-preview", | ||
| "EncodedRequestUri": "L3Byb3ZpZGVycy9NaWNyb3NvZnQuUmVzb3VyY2VHcmFwaC9yZXNvdXJjZXM/YXBpLXZlcnNpb249MjAxOC0wOS0wMS1wcmV2aWV3", | ||
| "RequestMethod": "POST", | ||
| "RequestBody": "", | ||
| "RequestHeaders": { | ||
| "Content-Type": [ | ||
| "application/json; charset=utf-8" | ||
| ], | ||
| "Content-Length": [ | ||
| "200" | ||
| ], | ||
| "x-ms-client-request-id": [ | ||
| "734561a3-74bf-4762-a941-20d98158229c" | ||
| ], | ||
| "accept-language": [ | ||
| "en-US" | ||
| ], | ||
| "User-Agent": [ | ||
| "FxVersion/4.7.3163.0", | ||
| "OSName/Windows10Enterprise", | ||
| "OSVersion/6.3.17134", | ||
| "Microsoft.Azure.Management.ResourceGraph.ResourceGraphClient/0.9.0.0" | ||
| ] | ||
| }, | ||
| "ResponseBody": "{\"totalRecords\":1,\"count\":1,\"data\":[{\"subscriptionId\":\"00000000-0000-0000-0000-000000000000\",\"tenantId\":\"00000000-0000-0000-0000-000000000000\",\"subscriptionDisplayName\":\"Test Subscription\",\"tenantDisplayName\":\"Test Tenant\"}],\"facets\":[],\"resultTruncated\":\"false\"}", | ||
| "ResponseHeaders": { | ||
| "Content-Length": [ | ||
| "179" | ||
| ], | ||
| "Content-Type": [ | ||
| "application/json; charset=utf-8" | ||
| ], | ||
| "Expires": [ | ||
| "-1" | ||
| ], | ||
| "Pragma": [ | ||
| "no-cache" | ||
| ], | ||
| "Strict-Transport-Security": [ | ||
| "max-age=31536000; includeSubDomains" | ||
| ], | ||
| "x-ms-ratelimit-remaining-tenant-writes": [ | ||
| "1199" | ||
| ], | ||
| "x-ms-request-id": [ | ||
| "e475050e-cb2f-4051-945e-0e1aed50d631" | ||
| ], | ||
| "x-ms-correlation-request-id": [ | ||
| "e475050e-cb2f-4051-945e-0e1aed50d631" | ||
| ], | ||
| "x-ms-routing-request-id": [ | ||
| "WESTUS2:20180913T223146Z:e475050e-cb2f-4051-945e-0e1aed50d631" | ||
| ], | ||
| "X-Content-Type-Options": [ | ||
| "nosniff" | ||
| ], | ||
| "Cache-Control": [ | ||
| "no-cache" | ||
| ], | ||
| "Date": [ | ||
| "Thu, 13 Sep 2018 22:31:46 GMT" | ||
| ], | ||
| "Server": [ | ||
| "Microsoft-HTTPAPI/2.0" | ||
| ] | ||
| }, | ||
| "StatusCode": 200 | ||
| } | ||
| ], | ||
| "Names": {}, | ||
| "Variables": { | ||
| "SubscriptionId": "00000000-0000-0000-0000-000000000000" | ||
| } | ||
| } |
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.