建立要搭配 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、Microsoft Intune 或 Office 365 等 Microsoft 雲端服務時,所收到並擁有的 Azure AD 服務專用執行個體。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 DirectorySelect 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