创建要用于 Power BI 的 Azure Active Directory 租户Create an Azure Active Directory tenant to use with Power BI

了解如何使用 Power BI REST API 新建用于自定义应用程序的 Azure Active Directory (Azure AD) 租户。Learn how to create a new Azure Active Directory (Azure AD) tenant for use with your custom application using the Power BI REST APIs.

在 Azure Active Directory 中,一个租户代表一个组织。A tenant is representative of an organization within Azure Active Directory. 它是 Azure AD 服务的一个专用实例,组织在注册 Azure、 Microsoft Intune 或 Office 365 等 Microsoft 云服务时收到并拥有它。It is a dedicated instance of the Azure AD service that an organization receives and owns when it signs up for a Microsoft cloud service such as Azure, Microsoft Intune, or Office 365. 各个 Azure AD 租户各不相同,相互独立。Each Azure AD tenant is distinct and separate from other Azure AD tenants.

拥有 Azure AD 租户后,可以定义应用程序并分配权限,以便应用程序使用 Power BI REST API。Once you have an Azure AD tenant, you can define an application and assign permissions so your application can make use of the Power BI REST APIs.

你的组织可能已拥有你可用于应用程序的 Azure AD 租户。Your organization may already have an Azure AD tenant that you can use for your application. 你的应用程序可以使用该租户,你也可以专门为你的应用程序创建新租户。You can make use of that tenant for your application needs or you can create a new tenant specifically for your application. 本文讨论如何创建新租户。This article looks at how to create a new tenant.

创建 Azure Active Directory 租户Create an Azure Active Directory tenant

若要将 Power BI 集成到自定义应用程序内,需要在 Azure AD 中定义应用程序。In order to integrate Power BI into your custom application, you need to define an application within Azure AD. 若要执行此操作,需要一个 Azure AD 内的目录。To do that, you need a directory within Azure AD. 这是你的租户。This is your tenant. 如果组织未使用 Power BI 或 Office 365,因此没有租户,则需要创建一个新租户If you organization doesn't have a tenant yet, because they aren't using Power BI or Office 365, you will need to create one. 如果不希望你的应用程序与组织的租户混合,可能也需要创建一个新租户。You may also need to create one if you don't want your application mixing with your organization's tenant. 这可以使内容保持独立。This allows you to keep things isolated.

或者,你可能只是出于测试目的创建租户。Or, you may just want to create a tenant for testing purposes.

若要创建新的 Azure AD 租户,请执行以下操作。To create a new Azure AD tenant, do the following.

  1. 浏览到 Azure 门户使用具备 Azure 订阅的帐户登录。Browse to the Azure portal and sign in with an account that has an Azure subscription.
  2. 选择“加号图标 (+)”并搜索“Azure Active Directory”。Select the plus icon (+) and search for Azure Active Directory.

  3. 在搜索结果中选择“Azure Active Directory”。Select Azure Active Directory in the search results.

  4. 选择“创建”。Select Create.
  5. 提供“组织名”和“初始域名”。Provide a name for the organization along with the initial domain name. 然后选择“创建”。Then select Create. 这将创建你的目录。This will create your directory.


    初始域将是 onmicrosoft.com 的一部分。以后可以添加其他域名。Your initial domain will be part of onmicrosoft.com. You can add other domain names later. 可以向租户目录分配多个域。The directory, of a tenant, can have multiple domains assigned to it.

  6. 目录创建操作完成后,选择信息框来管理新目录。After your directory creation is complete, select the information box to manage your new directory.

你的目录现已创建。Your directory is now created. 接下来,我们要向这个租户添加用户。Next we will want to add a user to the tenant.

在你的 Azure Active Directory 租户中创建一些用户Create some users in your Azure Active Directory tenant

我们已有目录,现在请创建至少两个用户。Now that we have a directory, let's create at least two users. 一个将作为租户的全局管理员,另一个作为用于嵌入的主用户。One that will be a Global Admin for the tenant and another that will be our master user for embedding. 将其视为服务帐户。Think of this as a service account.

  1. 在 Azure 门户中,确保位于 Azure Active Directory 浮出视窗上。Within the Azure portal, make sure we are on the Azure Active Directory fly out.

    如果不是,从左侧服务栏选择 Azure Active Directory 图标。If you are not, select the Azure Active Directory icon from the left services bar.

  2. 在“管理”下选择“用户和组”。Under Manage, select Users and groups.

  3. 选择“所有用户”,然后选择“+ 新建用户”。Select All users and then select + New user.
  4. 为此用户提供名称和用户名。Provide a name and username for this user. 这将是租户的全局管理员。This will be your Global Admin for the tenant. 还需把“目录角色”更改为“全局管理员”。You will also want to change the Directory role to Global administrator. 还可以显示临时密码。You can also show the temporary password. 完成后,选择“创建”。When you are done, select Create.

  5. 需要为租户中的一名普通用户再执行一次相同的操作。You will want to do the same thing again for a regular user in your tenant. 这可能还会用于你的主嵌入帐户。This could also be used for your master embedding account. 本次将“目录角色”保留为“用户”。This time, for Directory role, we will leave it as User. 请务必记下密码。Be sure to make note of the password. 然后选择“创建”。Then select Create.

  6. 用你在步骤 5 中创建的用户帐户注册 Power BI。Sign up for Power BI with your user account that you created in step 5. 要执行此操作,需转到 powerbi.com选择“Power BI - 云协作和共享”下的“免费试用”。You can do that by going to powerbi.com and selecting Try free under Power BI - Cloud collaboration and sharing.

    注册时,系统将提示你免费试用 Power BI Pro 60 天。When you sign up, you will be prompted to try Power BI Pro free for 60 days. 可以选择此项,成为一名 Pro 用户。You can opt into that to become a pro user. 如果需要,现在也可以开始开发嵌入解决方案。Now you can also start developing an embedded solution if that is what you are looking for.


    请确保使用指定给用户帐户的电子邮件地址进行注册。Make sure you sign up with the email address you gave the user account.

后续步骤Next steps

现在,你已有 Azure AD 租户,可以使用此租户来测试 Power BI 中的项,并且(或者)进一步在应用程序中嵌入 Power BI 仪表板和报表。Now that you have an Azure AD tenant, you can use this tenant to test items within Power BI, and/or you can move forward to embed Power BI dashboards and reports in your application. 有关如何嵌入项的详细信息,请参阅如何嵌入 Power BI 仪表板、报表和磁贴For more information on how to embed items, see How to embed your Power BI dashboards, reports and tiles.

什么是 Azure AD 目录?What is an Azure AD directory?
如何获取 Azure Active Directory 租户How to get an Azure Active Directory tenant

更多问题?More questions? 尝试咨询 Power BI 社区Try asking the Power BI Community