将租户添加到 Azure Stack Hub 以获取用量和计费信息Add 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 以跟踪用量并管理其租户之前,必须将 Azure Stack Hub 配置为 CSP。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.

下图演示了 CSP 需要执行哪些步骤才能让新的最终客户使用 Azure Stack Hub,并针对客户设置用量跟踪。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. 若要启用多租户计费,请将注册订阅 ID、资源组名称和注册名称发送到 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 CSP 帐户不同的帐户来管理客户的 Azure Stack Hub 订阅,以确保你不会失去访问客户的 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-AzureRmAccount -EnvironmentName AzureChinaCloud
    

    备注

    如果会话过期,密码已更改,或者只是希望切换帐户,请在使用 Add-AzureRmAccount 登录之前运行以下 cmdlet:Remove-AzureRmAccount-Scope Process****。If your session expires, your password has changed, or you simply wish to switch accounts, run the following cmdlet before you sign in using Add-AzureRmAccount: Remove-AzureRmAccount-Scope Process.

  2. 键入 Azure 凭据。Type your Azure credentials.

  3. 在 PowerShell 会话中运行:In the PowerShell session, run:

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

New-AzureRmResource PowerShell 参数New-AzureRmResource PowerShell parameters

以下部分描述 New-AzureRmResource cmdlet 的参数:The following section describes the parameters for the New-AzureRmResource 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. 客户订阅 ID 区分大小写。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