title: How to update existing user in Azure AD using Microsoft Graph API
body: <p>I have added a user in azure ad. Now using <code>graph api</code> I want to update its display name or let say password. I am referring to this guide <a href="https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&amp;tabs=cs" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/graph/api/user-update?view=graph-rest-1.0&amp;tabs=cs</a></p>
  
  <p>First of all, I am not sure I am using correct URL to update the user but below is what I am using:</p>
  
  <pre><code> https://graph.microsoft.com/v1.0/users/john@&lt;myorg&gt;.onmicrosoft.com
  </code></pre>
  
  <p>I am passing the <code>userName</code> of the user which I want to udpate in the url. Please let me know if this is not correct. </p>
  
  <p>I am including the <code>OAuth token</code> as bearer token in my request and posting the below json:</p>
  
  <pre><code>{
    "accountEnabled": true,
  
    "displayName": "john12"
  
  }
  </code></pre>
  
  <p>From the above json, I want to change the display name from <code>john</code> to <code>john12</code>. But I am getting below error:</p>
  
  <pre><code>{
      "error": {
          "code": "Request_BadRequest",
          "message": "Specified HTTP method is not allowed for the request target.",
          "innerError": {
              "request-id": "536fd7c1-db46-4927-9732-169da778811c",
              "date": "2019-06-06T04:58:26"
          }
      }
  }
  </code></pre>
  
  <p>Please can anyone please let me know how can I update the existing user properties. Thanks</p>