diff --git a/src/Contracts/AzureResourceGraph.ts b/src/Contracts/AzureResourceGraph.ts index 52120dec5..18eeed5a8 100644 --- a/src/Contracts/AzureResourceGraph.ts +++ b/src/Contracts/AzureResourceGraph.ts @@ -1,7 +1,8 @@ export interface QueryRequestOptions { $skipToken?: string; $top?: number; - subscriptions: string[]; + $allowPartialScopes: boolean; + subscriptions?: string[]; } export interface QueryResponse { diff --git a/src/hooks/useSubscriptions.tsx b/src/hooks/useSubscriptions.tsx index a8e4addf5..ca80a87f5 100644 --- a/src/hooks/useSubscriptions.tsx +++ b/src/hooks/useSubscriptions.tsx @@ -51,17 +51,13 @@ export async function fetchSubscriptionsFromGraph(accessToken: string): Promise< do { const body = { query: subscriptionsQuery, - ...(skipToken - ? { - options: { - $skipToken: skipToken, - } as QueryRequestOptions, - } - : { - options: { - $top: 150, - } as QueryRequestOptions, - }), + options: { + $allowPartialScopes: true, + $top: 150, + ...(skipToken && { + $skipToken: skipToken, + }), + } as QueryRequestOptions, }; const response = await fetch(managementResourceGraphAPIURL, {