Forum Discussion
Azure Resource Graph Connector - Only data for 1 directory, authorization problem
Hi.
I want to extract data from Azure Portal into Power BI Desktop using the Azure Resource Graph Connector (ARG) i Power BI Desktop.
However, only data for 1 directory is imported to Power BI.
The same query return data for the other directories when run in context of ARG Explorer.
(result depens on witch directory is used in azure portal)
Why does Power BI only return data for 1 of the directories?
Why does the authentication fail for queries run from Power BI, but not in ARG Explorer?
Below is the KQL queries used in both
- ARG Explorer un azure portal
- ARG Connector in Power BI
resources
| order by name asc
Query used in ARG Connector in Power BI
, as M code:
let
Source = AzureResourceGraph.Query("Resources#(lf)| order by name asc", null, null, null, [resultTruncated=null])
in
Source
Query result = only directory B
If I modify the query to have Subscription ID from Directory A, C, D or E, I get error "Access to the resource forbidden"
let
Source = AzureResourceGraph.Query("Resources", "Subscription", "XXXX-XXXX-XXXX-XXXX-XXXX", null, [resultTruncated=null])
in
Source
Directories available in Azure Portal:
Profil -> Switch directory
Thanks for the help.
Kind regards
Azure Resource Graph queries are scoped at the subscription level, so to query resources across multiple directories, you need to include subscriptions from each directory
i would suggest you using azure resource graph rest api rather than azure connector, sure you need to take care of authentication but you will have more control
with this you can get all the available subscriptions( might get different directory subscription as well)
and use these subscriptions to get data accordingly[ but remeber this method is not feasible if you wish to publish to service as you will not be able to refresh due to dynamic datasource issue ]
and when i comes to power bi connector that you are already using its probably due to scope of the account that you have logged in to
if this helps , please mark as solution
3 Replies
- Vijay_ChethanResolver III
Azure Resource Graph queries are scoped at the subscription level, so to query resources across multiple directories, you need to include subscriptions from each directory
i would suggest you using azure resource graph rest api rather than azure connector, sure you need to take care of authentication but you will have more control
with this you can get all the available subscriptions( might get different directory subscription as well)
and use these subscriptions to get data accordingly[ but remeber this method is not feasible if you wish to publish to service as you will not be able to refresh due to dynamic datasource issue ]
and when i comes to power bi connector that you are already using its probably due to scope of the account that you have logged in to
if this helps , please mark as solution - v-kathullacCommunity Support
Hi Anonymous ,
As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.Regards,
Chaithanya. - AnonymousNot applicable
Thanks for the reply Vijay_Chethan , your suggestions is accepted as solution
Kind regards