Set AllowPartialScopes flag to true (#1900)

* add partial scopes flag

* add partial scopes flag

* add partial scopes flag

---------

Co-authored-by: Asier Isayas <aisayas@microsoft.com>
This commit is contained in:
Asier Isayas 2024-07-08 16:30:14 -04:00 committed by GitHub
parent 093ddba2db
commit e9f83a8efd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 12 deletions

View File

@ -1,7 +1,8 @@
export interface QueryRequestOptions { export interface QueryRequestOptions {
$skipToken?: string; $skipToken?: string;
$top?: number; $top?: number;
subscriptions: string[]; $allowPartialScopes: boolean;
subscriptions?: string[];
} }
export interface QueryResponse { export interface QueryResponse {

View File

@ -51,17 +51,13 @@ export async function fetchSubscriptionsFromGraph(accessToken: string): Promise<
do { do {
const body = { const body = {
query: subscriptionsQuery, query: subscriptionsQuery,
...(skipToken options: {
? { $allowPartialScopes: true,
options: { $top: 150,
$skipToken: skipToken, ...(skipToken && {
} as QueryRequestOptions, $skipToken: skipToken,
} }),
: { } as QueryRequestOptions,
options: {
$top: 150,
} as QueryRequestOptions,
}),
}; };
const response = await fetch(managementResourceGraphAPIURL, { const response = await fetch(managementResourceGraphAPIURL, {