title: how to set User administrator role to azure active directory application through graph API
body: <p>I want to delete a user from azure AD B2C using graph API. I register a new application for this purpose to get permission for graph API.
  <a href="https://docs.microsoft.com/en-us/graph/api/application-post-applications?view=graph-rest-1.0&amp;tabs=http" rel="nofollow noreferrer">Create app</a></p>
  <ol>
  <li>Then i create a service principle for  application using below link
  <a href="https://docs.microsoft.com/en-gb/graph/api/serviceprincipal-post-serviceprincipals?view=graph-rest-1.0&amp;tabs=http" rel="nofollow noreferrer">Create Service principle</a></li>
  <li>next step is user role assignment to application.I want to set user administer role to application
  <a href="https://i.stack.imgur.com/USqQU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/USqQU.png" alt="enter image description here" /></a></li>
  </ol>
  <blockquote>
  <pre><code>POST https://graph.microsoft.com/v1.0/servicePrincipals/{resource-id}/appRoleAssignedTo
  { &quot;principalId&quot;: &quot;{principal-id}&quot;, 
    &quot;resourceId&quot;: &quot;{resource-id}&quot;, 
    &quot;appRoleId&quot;: &quot;{app-role-id}&quot; 
  }
  </code></pre>
  </blockquote>
  <p>i got the service principle id from service principle object
  @odata.context                         :</p>
  <pre><code>https://graph.microsoft.com/v1.0/$metadata#servicePrincipals/$entity
  id                                     : xxxxxxxxxxxxxxxxxxxxxxxxx
  deletedDateTime                        : 
  accountEnabled                         : True
  alternativeNames                       : {}
  appDisplayName                         : xxx
  appDescription                         : 
  appId                                  : xxxxxxxxxx
  applicationTemplateId                  : 
  appOwnerOrganizationId                 : xxxxxxxxxxxxxxxx
  appRoleAssignmentRequired              : False
  createdDateTime                        : 
  description                            : 
  displayName                            : xxxx
  homepage                               : 
  loginUrl                               : 
  logoutUrl                              : 
  notes                                  : 
  notificationEmailAddresses             : {}
  preferredSingleSignOnMode              : 
  preferredTokenSigningKeyThumbprint     : 
  replyUrls                              : {}
  resourceSpecificApplicationPermissions : {}
  samlSingleSignOnSettings               : 
  servicePrincipalNames                  : {cxxxxx}
  servicePrincipalType                   : Application
  signInAudience                         : AzureADMyOrg
  tags                                   : {}
  tokenEncryptionKeyId                   : 
  verifiedPublisher                      : @{displayName=; verifiedPublisherId=; addedDateTime=}
  addIns                                 : {}
  appRoles                               : {}
  info                                   : @{logoUrl=; marketingUrl=; privacyStatementUrl=; supportUrl=; termsOfServiceUrl=}
  keyCredentials                         : {}
  oauth2PermissionScopes                 : {}
  passwordCredentials                    : {}
  </code></pre>
  <p>i assumed  principalId is id    of the object and resource id is same.
  Then how do  i get the appRoleId</p>