This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

API Poller: Azure REST API

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!

Parents Reply Children
  •  interested in your outcome. We are still on 2019.4 and a device requires token authorisation 

  • Let us know how your experience with 2020.2 goes, we'd love to know your feedback to see how we can improve. 

  • Nice to hear! Also interested in hearing how that works. API polling in 2020.2 looks great, but I won't be able to try it out until GA release.

  • 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 Problem
    I 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 Problem
    Once 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.

     Is there any way you can ask a developer? I really need this.
     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 

    serena_0-1589317835225.png

    you'll have access to a selection of templates: 

    serena_1-1589317869897.png

  • Thanks for the response. Yes, I have, but I am not sure how they can work without getting the authentication for Azure REST working successfully. I would love to see how one someone has successfully made the authentication work, whatever method you used.

  • Hey There!

    We're currently doing UX testing for some new features to do with API Pollers that I think you'll be interested in checking out. Please let me know if you have some time coming up to give us your feedback on them - UX sessions take about an hour, you get 3,000 THWACK points and you'll get a sneak peek on what we're working on!

    Send me an email if you're interested

    carley.cousineau@solarwinds.com

    Thanks!

    Carley

  • Thanks  , I am interested and I sent you a message. I think REST API polling is a critical aspect of modern day monitoring. Also, if you have any advice on how the authentication actually works with Azure REST, then please share. The Azure templates are great and I know the GET requests in them work, but I would like to think the authentication for Azure was tested as well in order to make the templates actually work.

  •   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:

    • "Credential name" -> your friendly name 
    • "Client ID" -> "Application (client) ID" available in your Azure portal (Azure Active Direcory service -> App registrations -> Your App)
    • "Client Secret" -> "Client secrets" available in your Azure portal (Azure Active Direcory service -> App registrations -> Your App -> Certificates & secrets)
    • "Access Token URL" -> https://login.microsoftonline.com/{{tenantId}}/oauth2/v2.0/token, where {{tenantId}} is your Azure tenantId (Azure Active Direcory service -> App registrations -> Your App -> Directory (tenant) ID)
    • "Scope" -> "https://management.azure.com/.default" (assuming you are trying to monitor: https://management.azure.com endpoints)

    Sample configuration below:

     
     

    SampleAzureManagementCredential.png

    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?

  •  You nailed it! That absolutely solved the Authentication issues. I very much appreciate you and  help!! I know this will go a long way in helping other people too.