使用 REST API 在 Azure 门户上进行用户配置。可能吗?

User Provisioning on Azure Portal using REST APIs. Is it possible?

要将用户添加到我们的 Azure 组织,我们转到此页面 https://portal.azure.com/#blade/Microsoft_AAD_IAM/UsersManagementMenuBlade/AllUsers,然后创建或邀请新用户。

是否可以通过 REST API 实现?我查看了他们的 REST API 文档 https://docs.microsoft.com/en-us/rest/api/apimanagement/ 但我无法在任何地方找到此信息。

您可以找到创建用户的 Grprah API 参考资料 here. The Graph API quick-start 可以通过示例代码帮助您创建用户。

您需要确保您在尝试创建用户的 Azure AD 中拥有用户创建权限。通常,我们的帐户必须在目录中具有用户帐户管理员角色或全局管理员角色。

您可以为此 API 使用 Azure Graph API. In this link you can find an example for creating a user using the Graph API and here is the quick start guide。 基本上,它看起来如下:

POST https://graph.windows.net/myorganization/users?api-version
Authorization: Bearer {token}
Content-type: application/json

{
  "accountEnabled": true,
  "displayName": "Alex Wu",
  "mailNickname": "AlexW",
  "passwordProfile": {
    "password": "Test1234",
    "forceChangePasswordNextLogin": false
  },
  "userPrincipalName": "Alex@a830edad9050849NDA1.onmicrosoft.com"
}