將用於使用量與帳單的租用戶新增至 Azure Stack HubAdd tenant for usage and billing to Azure Stack Hub

本文說明如何將租用戶新增至由雲端解決方案提供者 (CSP) 所管理的 Azure Stack Hub 部署。This article describes how to add a tenant to an Azure Stack Hub deployment managed by a Cloud Solution Provider (CSP). 當新的租用戶使用資源時,Azure Stack Hub 會向其 CSP 訂用帳戶報告使用量。When the new tenant uses resources, Azure Stack Hub reports usage to their CSP subscription.

CSP 通常會為其 Azure Stack Hub 部署上的多位終端客戶 (租用戶) 提供服務。CSPs often offer services to multiple end customers (tenants) on their Azure Stack Hub deployment. 將租用戶新增到 Azure Stack Hub 註冊可確保系統會報告每個租用戶的使用量,且費用會計入相對應的 CSP 訂用帳戶。Adding tenants to the Azure Stack Hub registration ensures that each tenant's usage is reported and billed to the corresponding CSP subscription. 如果您未完成本文中的步驟,租用戶使用量費用會計入 Azure Stack Hub 初始註冊所使用的訂用帳戶。If you don't complete the steps in this article, tenant usage is charged to the subscription used in the initial registration of Azure Stack Hub. 您必須先將 Azure Stack Hub 設定為 CSP 後,才能將終端客戶新增至 Azure Stack Hub,以進行使用量追蹤並管理其租用戶。Before you can add an end customer to Azure Stack Hub for usage tracking and to manage their tenant, you must configure Azure Stack Hub as a CSP. 如需步驟和資源,請參閱以雲端解決方案提供者身分管理 Azure Stack Hub 的使用量和帳單For steps and resources, see Manage usage and billing for Azure Stack Hub as a Cloud Solution Provider.

下圖顯示要讓新的終端客戶能夠使用 Azure Stack Hub 以及設定客戶使用量追蹤,CSP 所必須遵循的步驟。The following figure shows the steps that a CSP needs to follow to enable a new end customer to use Azure Stack Hub, and to set up usage tracking for the customer. 透過新增終端客戶,您也能夠管理 Azure Stack Hub 中的資源。By adding the end customer, you're also able to manage resources in Azure Stack Hub. 您有兩個選項可管理其資源:You have two options for managing their resources:

  • 您可以保有終端客戶,並將本機 Azure Stack Hub 訂用帳戶的認證提供給終端客戶。You can maintain the end customer and provide credentials for the local Azure Stack Hub subscription to the end customer.
  • 終端客戶可在本機使用其訂用帳戶,並將 CSP 新增為具有擁有者權限的來賓。The end customer can work with their subscription locally and add the CSP as a guest with owner permissions.

新增終端客戶Add an end customer

在新增終端客戶之前,您必須先在註冊上啟用多租用戶計費。Before you add an end customer, you must enable multi-tenant billing on your registration. 若要啟用多租用戶計費,請將註冊訂用帳戶識別碼、資源群組名稱和註冊名稱傳送至 azstcsp@microsoft.comIn order to enable multi-tenant billing, send the registration subscription ID, resource group name, and registration name to azstcsp@microsoft.com. 通常要 1 到 2 個工作天才能啟用多租用戶。It usually takes 1-2 business days to enable multi-tenancy.

執行下列步驟來新增終端客戶,如下圖所示:Perform the following steps to add an end customer, as pictured in the following figure:

設定雲端解決方案提供者以進行使用量追蹤,以及管理終端客戶帳戶

在合作夥伴中心建立新的客戶Create a new customer in Partner Center

在合作夥伴中心為客戶建立新的 Azure 訂用帳戶。In Partner Center, create a new Azure subscription for the customer. 如需指示,請參閱新增客戶For instructions, see Add a new customer.

建立終端客戶的 Azure 訂用帳戶Create an Azure subscription for the end customer

在合作夥伴中心內建立客戶的記錄之後,您就可以向他們銷售目錄中產品的訂用帳戶。After you've created a record of your customer in Partner Center, you can sell them subscriptions to products in the catalog. 如需指示,請參閱建立、暫止或取消客戶的訂用帳戶For instructions, see Create, suspend, or cancel customer subscriptions.

在終端客戶目錄中建立來賓使用者Create a guest user in the end customer directory

根據預設,CSP 並無法存取終端客戶的 Azure Stack Hub 訂用帳戶。By default, you, as the CSP, do not have access to the end customer's Azure Stack Hub subscription. 不過,若客戶請您管理其資源,便可將您的帳戶新增為其 Azure Stack Hub 訂用帳戶的擁有者/參與者。However, if your customer wants you to manage their resources, they can then add your account as owner/contributor to their Azure Stack Hub subscription. 若要這樣做,客戶必須將您的帳戶新增為其 Azure AD 租用戶的來賓使用者。In order to do that, they must add your account as a guest user to their Azure AD tenant. 建議您在管理客戶的 Azure Stack Hub 訂用帳戶時使用與您 Azure CSP 帳戶不同的帳戶,以確保您不會失去客戶的 Azure 訂用帳戶存取權。It's advised that you use a different account from your Azure CSP account to manage your customer's Azure Stack Hub subscription to ensure you don't lose access to your customer's Azure subscription.

使用終端客戶訂用帳戶更新註冊Update the registration with the end customer subscription

使用新客戶的訂用帳戶更新您的註冊。Update your registration with the new customer subscription. Azure 會使用來自「合作夥伴中心」的客戶身分識別來報告客戶的使用量。Azure reports the customer usage using the customer identity from Partner Center. 這個步驟可確保每個客戶的使用量都會報告在該客戶的個別 CSP 訂用帳戶底下。This step ensures that each customer's usage is reported under that customer's individual CSP subscription. 這可讓您更輕鬆地追蹤使用量與帳單。This makes tracking usage and billing easier. 若要執行此步驟,您必須先註冊 Azure Stack HubTo perform this step, you must first register Azure Stack Hub.

  1. 在已提升權限的提示字元中開啟 Windows PowerShell,然後執行:Open Windows PowerShell in an elevated prompt, and run:

    Add-AzAccount
    

    注意

    如果您的會話已過期,您的密碼已變更,或您只是想要切換帳戶,請先執行下列 Cmdlet,然後再使用 disconnect-azaccount:進行登入 Remove-AzAccount-Scope ProcessIf your session expires, your password has changed, or you simply wish to switch accounts, run the following cmdlet before you sign in using Add-AzAccount: Remove-AzAccount-Scope Process.

  2. 輸入您的 Azure 認證。Type your Azure credentials.

  3. 在 PowerShell 工作階段中,執行:In the PowerShell session, run:

    New-AzResource -ResourceId "subscriptions/{registrationSubscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.AzureStack/registrations/{registrationName}/customerSubscriptions/{customerSubscriptionId}" -ApiVersion 2017-06-01
    

新 Get-azresource 的 PowerShell 參數New-AzResource PowerShell parameters

下一節說明 get-azresource Cmdlet 的參數:The following section describes the parameters for the New-AzResource cmdlet:

參數Parameter 描述Description
registrationSubscriptionIDregistrationSubscriptionID 用於進行 Azure Stack Hub 初始註冊的 Azure 訂用帳戶。The Azure subscription that was used for the initial registration of the Azure Stack Hub.
customerSubscriptionIDcustomerSubscriptionID 客戶要用來註冊的 Azure 訂用帳戶 (非 Azure Stack Hub)。The Azure subscription (not Azure Stack Hub) belonging to the customer to be registered. 必須建立在 CSP 供應項目中。Must be created in the CSP offer. 實務上,這表示要透過合作夥伴中心。In practice, this means through Partner Center. 如果客戶有多個 Azure Active Directory 租用戶,則必須將此訂用帳戶建立在要用來登入 Azure Stack Hub 的租用戶中。If a customer has more than one Azure Active Directory tenant, this subscription must be created in the tenant that will be used to log into Azure Stack Hub. 客戶的訂用帳戶識別碼會區分大小寫。The customer subscription ID is case sensitive.
resourceGroupresourceGroup Azure 中用來儲存註冊的資源群組。The resource group in Azure in which your registration is stored.
registrationNameregistrationName 您 Azure Stack Hub 註冊的名稱。The name of the registration of your Azure Stack Hub. 其為儲存在 Azure 中的物件。It's an object stored in Azure.

注意

租用戶必須向他們所使用的每個 Azure Stack Hub 註冊。Tenants must be registered with each Azure Stack Hub they use. 如果您有兩個 Azure Stack Hub 部署,且租用戶會使用這兩個部署,則您必須使用租用戶訂用帳戶更新每個部署的初始註冊。If you have two Azure Stack Hub deployments, and a tenant uses both of them, you must update the initial registrations of each deployment with the tenant subscription.

將租用戶上架到 Azure Stack HubOnboard tenant to Azure Stack Hub

設定 Azure Stack Hub,以支援來自多重 Azure AD 租用戶的使用者在 Azure Stack Hub 中使用服務。Configure Azure Stack Hub to support users from multiple Azure AD tenants to use services in Azure Stack Hub. 如需指示,請參閱在 Azure Stack Hub 中啟用多重租用For instructions, see Enable multi-tenancy in Azure Stack Hub.

在 Azure Stack Hub 的終端客戶租用戶中建立本機資源Create a local resource in the end customer tenant in Azure Stack Hub

一旦您已將新客戶新增至 Azure Stack Hub,或是終端客戶租用戶已啟用您具有擁有者權限的來賓帳戶後,請確認您可以在其租用戶中建立資源。Once you've added the new customer to Azure Stack Hub, or the end customer tenant has enabled your guest account with owner privileges, verify that you can create a resource in their tenant. 例如,他們可以使用 Azure Stack Hub 入口網站建立 Windows 虛擬機器For example, they can Create a Windows virtual machine with the Azure Stack Hub portal.

後續步驟Next steps