Deleting/Purge data from Azure Application Insights

拥有回忆 提交于 2019-12-20 06:45:55

问题


The following page shows how can I purge Application Insights data -

https://docs.microsoft.com/en-us/rest/api/application-insights/components/purge

I tried following it but it doesn't mention how to use authentication and I am getting the following error in response -

{
"error": {
    "code": "AuthenticationFailed",
    "message": "Authentication failed. The 'Authorization' header is missing."
}

Can someone please guide me how do use the authentication header?


回答1:


As per joy said in comment, just go to the website, and click "try it" -> log use your credential, then you can see the token:




回答2:


On the page you linked to, scroll all the way up in the menu and find 'Getting started with REST'. When you click that and scroll the page, you find Register your client application with Azure AD.

Most Azure services (such as Azure Resource Manager providers and the classic deployment model) require your client code to authenticate with valid credentials before you can call the service's API. Authentication is coordinated between the various actors by Azure AD, and provides your client with an access token as proof of the authentication. The token is then sent to the Azure service in the HTTP Authorization header of subsequent REST API requests. The token's claims also provide information to the service, allowing it to validate the client and perform any required authorization.

Long story short:

  • Register your client application with Azure AD
  • Create the request
    • Acquire an access token
    • Assemble the request message
  • Send the request
  • Process the response message



回答3:


You need authorization header to be added in your request to purge the azure application insights data. Refer for more details and step by step guide - https://sanganakauthority.blogspot.com/2019/06/how-to-delete-or-purge-azure.html



来源:https://stackoverflow.com/questions/53881491/deleting-purge-data-from-azure-application-insights

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!