title: How To Add Users to an App Group and Role with Microsoft Graph
body: <p>I have a C# .NET MVC Web App on Azure that I've turned Easy Auth on for Azure AD accounts.  </p>
  
  <p>I'm trying to add a user to this web app's "Users and Groups" list associated with the App Registration and assign it a Role defined by the associated manifest.</p>
  
  <p>So far I'm able to get the app's manifest (which contains the app roles' info, such as the id and name) with this call made in my controller:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public JObject GetRoleInfoViaId(string appObjectId)
  {
      string accessToken = this.Request.Headers["X-MS-TOKEN-AAD-ACCESS-TOKEN"]; // Get Easy Auth Access Token
      var url = $"https://graph.microsoft.com/beta/applications/{appObjectId}"; // MS Graph
  
      // Call the URL and return the response
      using (var httpClient = new HttpClient())
      {
          httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
          var response = httpClient.GetStringAsync(url).Result;
          var json = JObject.Parse(response);
  
          return json;
      }
  }
  </code></pre>
  
  <p>From here I'm stuck. I have no idea how to go about adding a user to the app and/or app role.</p>
  
  <p>If this is not possible in Microsoft Graph yet, I can switch this to Azure AD Graph. It's the functionality I'm after.</p>