none
Getting Unauthorized error while trying to call a rest to get the sync status of an Azure Analysis Service model RRS feed

  • Question

  • I am trying to get sync status of an AAS model using the /sync rest api using postman.

    For the Authorization step,

    I have created a Web app / API App and given the following as the OAuth2 get access token inputs in postman:

    Auth URL: https://login.microsoftonline.com/<directory_id>/oauth2/authorize?resource=<Application ID>

    Access Token URL: https://login.microsoftonline.com/<directory_id>/oauth2/token?resource=<Application ID>

    Client ID: <Application ID>

    Client Secret: <Secret>

    Grant Type: Authorization Code

    Following are the permissions given in App:

    • Azure Analysis Services: Read and Write all Models
    • Windows Azure Active Directory

    I have also added the app as Owner in my AAS Access Control - Role assignment

    With the above settings, I was able to get the access token in postman and added it as header for the request.

    After adding the header, I executed the following:

    GET https://<location>.asazure.windows.net/servers/<db>/models/<model>/sync

    Which resulted in the error:

    {
      "code": "Unauthorized",
      "subCode": 0,
      "message": "Authentication failed.",
      "timeStamp": "2018-09-11T14:02:07.3296959Z",
      "httpStatusCode": 401,
      "details": [
        {
          "code": "RootActivityId",
          "message": "bce8ed04-5c13-44e4-a5cc-43979e777586"
        }
      ]
    }

    Please help me on getting the sync status of an AAS model.

    Tuesday, September 11, 2018 3:00 PM

All replies

  • It seems like you are doing most of the things right. Except there is not on this link that says, you need to have server admin role permission to execute these calls. Can you please add this role and try it again?
    Thursday, September 20, 2018 7:29 PM
    Moderator