Has anyone successfully used the API Poller to poll Azure? I'm in desperate need of some help to get this working. Can anyone provide some information on the steps needed to successfully poll Azure (from start to finish)? Please help!
@LatteLarry Azure REST requires using OAuth2.0 credential, what is supported by API Poller starting from 2020.2 RC
Here are the steps to configure it:
1. Create API Poller to monitor Azure
2. Go to Configure option
3. Select OAuth2.0 Authorization
4. Click "New credential"
5. Fill all the fields:
Sample configuration below:
Let us know if that helps and if you have any other questions or needs.
What is the URL you would like to use in API Poller request?
Can you provide any information about where in this process this is failing for you?
@sturdyerde Sure thing... I have my GET request all figured out in POSTMAN. The part I am unclear on is how to do I use token based authentication (that expire) in the Solarwinds API Poller? It only uses basic username and PW based authentication.To give more context, I followed this blog post for my authentication and to create my GET request for the Azure resources I need.
@sturdyerde My apologies, see below... This should be very helpful for other people as well.
https://blog.jongallant.com/2017/11/azure-rest-apis-postman/
Not too worried about transfering the GET request and headers to the Orion API Poller, more just trying to figure out how to do the authentication.
Not sure if you saw my reply because of how it got posted into the thread. Let me know if the newer walk-throughs help.
Thanks for the response and help! I actually just installed 2020.2 earlier today. It's pretty cool and looks like it may get me past my struggles. Just need to mess around with it a little more. I should have an update over the next few days.
@LatteLarry interested in your outcome. We are still on 2019.4 and a device requires token authorisation
Ok... First off, I'm very impressed with all of the new features and enhancements of 2020.2. The release was much needed and I'm very happy I upgraded!The API Poller enhancements have gotten me past some of my struggles with other providers, but I still struggle with the Azure REST API. My struggle is with the OAuth2.0 authentication Azure REST uses.
First ProblemI cannot get my POST request to work in order to obtain the Bearer token. My POST looks like this: https://login.microsoftonline.com/{{tenantId}}/oauth2/token. I replace tenantId with my actual tenant ID. No matter what I try, it returns with a 400 status code saying "The request body must contain the following parameter: 'grant_type'." It doesn't matter what I do to pass grant_type in the body, it doesn't work. Without this, I have no way to get my bearer token for authentication.
Second ProblemOnce I finally get my POST to work and it returns with a bearer token, how do I pass it through to my GET requests? Or how do I pass any variables through?I have to think this has been tested and works? Otherwise, there's no way you can effectively do API Polling against Azure. My GET request does actually work. I can manually generate my bearer token and manually pass it through on my GET requests to Azure for successful responses. The POST and passing variables is the struggle.
@serena Is there any way you can ask a developer? I really need this.@sturdyerde Any ideas?
Hey there! I'm so glad you upgraded, and are enjoying all of the improvements. When working with the 2020.2 API poller, have you tried one of the Azure templates as a starter?
clicking Assign
you'll have access to a selection of templates:
Hello Serena,
We are getting below error in API poller . Azure AD API Poller.
Response status : Unauthorized Response status code : 401 Response time (ms) : 84
error :code : InvalidAuthenticationTokenmessage : Access token validation failure. Invalid audience.
Thanks
@alankar.srivastava Looks like incorrect scope for OAuth2.0 credentials.
Microsoft Azure Active Directory API Poller need to have OAuth 2.0 Azure credentials configured with scope: https://graph.microsoft.com/.default
Let us know if that helps
Hello @jan.rachwalik ,
Will it be only work with default scope? What if we have created dedicated scope link.
Thanks,
Alankar
@alankar.srivastava We tested it with the default scope only. I would recommend to start with default one and once you get all the data you need try to update the scope to meet your requirement.
Let us know where you ended up.
refer thishttps://thwack.solarwinds.com/product-forums/server-application-monitor-sam/f/forum/93220/how-to-monitor-any-azure-services-using-api-pollingplease mark is as correct answer