簡體   English   中英

Azure Application Insights REST API

[英]Azure Application Insights REST API

是否有適當的示例使用Azure API和Azure Active Directory使用Azure Application Insights REST API?

頂層頁面上有同時使用API​​密鑰和Azure AAD的示例:

https://dev.applicationinsights.io/documentation/Authorization

使用公共API格式:API密鑰身份驗證

 https://api.applicationinsights.io/{api-version}/{app-id}/{query-path}?[query-parameters] 

https://dev.applicationinsights.io/documentation/Authorization/API-key-authentication

使用Azure API格式:用戶身份驗證

如果使用的是Azure API格式 ,則授權由Azure Active Directory完成 如果您使用特定的AAD身份驗證方案進行每用戶身份驗證,則可以了解更多信息。

有關如何使用AAD身份驗證的有用資源是《使用Azure資源管理器API進行身份驗證的開發人員指南》 ,該站點還提供了一組有用的PowerShell cmdlet,用於處理針對AAD身份驗證以及通過ARM發送API調用的詳細信息。 它們是獲取目標Fiddler會話集的快速方法,該會話集顯示了通過ARM進行身份驗證和API調用的實際調用(與直接指向API的API密鑰)。

例如,以下一系列PowerShell命令將運行Analytics查詢並轉儲JSON響應:

 Connect-ARM Execute-ARMQuery -SubscriptionId {subscription-id} -HTTPVerb GET -Base "/subscriptions/{subscription-id}/resourcegroups/{resource-group-name}/providers/microsoft.insights/components/{ai-component-name}/api/query" -APIVersion "2014-12-01-preview" -Query "&query=requests|count" | ConvertTo-Json -Depth 99 

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM