Azure应用程序洞察REST API
是否有任何合适的示例使用Azure API和Azure Active Directory来使用Azure Application Insights REST API?Azure应用程序洞察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 format,则授权由Azure Active Directory完成。如果您使用此功能执行每个用户的 身份验证,您可以了解有关特定的 AAD authentication scenarios的更多信息。
如何使用AAD认证的有用资源是 Developer's Guide to Auth with Azure Resource Manager API和 这个网站也有一个useful set of PowerShell cmdlets处理 认证对AAD并通过 ARM发送API调用的细节。他们是获得有针对性的Fiddler会话集的一种快速方式, 显示了通过ARM进行身份验证和调用我们的API的实际调用(与直接访问API的API关键字相比,这是 )。
例如,PowerShell中的这个命令序列将运行 Analytics query和倾倒了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
它可以通过nodejs完成吗?我可以用邮差或其他东西来测试它吗? –
不知道想你的意思。 –
在api文档1中提供了两种方法:API密钥身份验证和2. Azure Active Directory身份验证,但第二种方法没有示例。我面临api速率限制问题与第一种方法,所以我想使用第二种方法 –
你能为我提供该文档的链接? –