title: Microsoft Azure OAuth Client Credentials Token gets "AuthorizationFailed" response
body: <p>I want create APIM subscriptions through rest api, And was able to do it successfully by following this Microsoft doc, <a href="https://docs.microsoft.com/en-us/rest/api/apimanagement/current-ga/subscription" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/rest/api/apimanagement/current-ga/subscription</a>.</p>
  <p>And for Authentication I am generating a bearer token using ROPC grant type(My UserName &amp; Password). Everything works fine with this flow.</p>
  <p>But i dont want to configure my username &amp; password in a application to get a bearer token, instead i followed Client-Credentials grant type(get token by client id &amp; secret), i am able to generate token, but when i use that token to create subscription in APIM, i am getting a exception
  <strong>The client '0</strong><em><strong>-</strong></em><strong>-</strong><em>e' with object id '0<em><strong><strong>-</strong></strong></em>-</em><strong>e' does not have authorization to perform action 'Microsoft.ApiManagement/service/subscriptions/write'</strong></p>
  <p>Is it possible to add a AAD application inside APIM AccessControl(IAM) to grant permission.
  Or is this any other way to do this? or ROPC is the only way?</p>
  <p>Can someone please help.</p>