英文:
Azure Resource Graph API - Get Resources table via Data Factory
问题
I'm creating a Data Factory pipeline with Web Activity, and that activity is using Azure Resource Graph API to query the resources table. And after I'll use copy data activity to copy the data to a blob container. I already created it but the output file returns the same Web Activity results.
For example, and using the Web Activity, it is working well, but only returns 201 rows and if I execute the kusto query in Azure Graph Explorer returns 286 rows.
And if I filter by type = "microsoft.desktopvirtualization/hostpools" it will return 0 rows via API, but in Azure Graph Explorer returns 2 rows. I think it will only query the first 200 lines and not the whole set because I tried with order by asc or desc and with "| take 500" (for example) and it didn't work either.
I checked the Microsoft documentation and it says that the limit is 1000 rows, so I don't understand why it doesn't return more rows.
Results with type filter:
Azure Graph Explorer:
ADF Output:
ADF Pipeline:
URL: https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01
Method: POST
Body:
{
"query": "resources"
}
Resource: https://management.azure.com
Headers: Content-Type; application/json
英文:
I'm creating a Data Factory pipeline with Web Activity, and that activity is using Azure Resource Graph API to query the resources table. And after I'll use copy data activity to copy the data to blob container. I already created it but the output file returns the same Web Activity results.
For example, and using the Web Activity,it is working well, but only returns 201 rows and if I execute the kusto query in Azure Graph Explorer returns 286 rows.
And if I filter by type = "microsoft.desktopvirtualization/hostpools" it will return 0 rows via API, but in Azure Graph Explorer returns 2 rows I think it will only queries the first 200 lines and not the whole set, because I tried with order by asc or desc and with "| take 500" (for example) and it didn't work either.
I checked the microsoft documentation and it says that the limit is 1000 rows, so I don't understand why it doesn't return more rows:
Results with type filter:
Azure Graph Explorer:
ADF Output:
ADF Pipeline:
URL: https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2021-03-01
Method: POST
Body:
{
"query": "resources"
}
Resource: https://management.azure.com
Headers: Content-Type; application/json
Does anyone have similar issue/experience?
Thanks a lot!
答案1
得分: 1
你需要检查Azure数据工厂的访问权限。它需要在您期望在API调用中返回的所有Azure资源上具有读取者角色:
您可以在资源、资源组、订阅或管理组级别分配角色。
干杯!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论