向 Azure 註冊 Azure Stack HubRegister Azure Stack Hub with Azure

向 Azure 註冊 Azure Stack Hub,以便從 Azure 下載 Azure Marketplace 項目,以及設定向 Microsoft 回報商務資料的功能。Register Azure Stack Hub with Azure so you can download Azure Marketplace items from Azure and set up commerce data reporting back to Microsoft. 註冊 Azure Stack Hub 之後,使用方式會回報給 Azure 商務報告,您可以在註冊所用的 Azure 計費訂用帳戶識別碼下查看報告。After you register Azure Stack Hub, usage is reported to Azure commerce and you can see it under the Azure billing Subscription ID used for registration.

本文中的資訊說明如何向 Azure 註冊 Azure Stack Hub 整合系統。The information in this article describes registering Azure Stack Hub integrated systems with Azure. 如需向 Azure 註冊 ASDK 的相關資訊,請參閱 ASDK 文件中的 Azure Stack Hub 註冊For information about registering the ASDK with Azure, see Azure Stack Hub registration in the ASDK documentation.

重要

必須註冊才能支援完整的 Azure Stack Hub 功能,包括在 Marketplace 中提供項目。Registration is required to support full Azure Stack Hub functionality, including offering items in the marketplace. 如果您在使用隨用隨付計費模型時未註冊,則會違反 Azure Stack Hub 授權條款。You'll be in violation of Azure Stack Hub licensing terms if you don't register when using the pay-as-you-use billing model. 若要深入了解 Azure Stack Hub 授權模型,請參閱如何購買頁面To learn more about Azure Stack Hub licensing models, see the How to buy page.

必要條件Prerequisites

註冊之前請先完成下列必要條件:Complete the following prerequisites before you register:

  • 確認認證。Verify your credentials.
  • 設定 PowerShell 語言模式。Set the PowerShell language mode.
  • 安裝適用於 Azure Stack Hub 的 PowerShell。Install PowerShell for Azure Stack Hub.
  • 下載 Azure Stack Hub 工具。Download the Azure Stack Hub tools.
  • 決定您的計費模型。Determine your billing model.
  • 決定唯一的註冊名稱。Determine your unique registration name.

確認認證Verify your credentials

使用 Azure 註冊 Azure Stack Hub 之前,您必須:Before registering Azure Stack Hub with Azure, you must have:

  • Azure 訂用帳戶的訂用帳戶 ID。The subscription ID for an Azure subscription. 只有 EA、CSP 或 CSP 共用服務訂用帳戶支援註冊。Only EA, CSP, or CSP shared services subscriptions are supported for registration. CSP 必須決定要使用 CSP 或 APSS 訂用帳戶CSPs need to decide whether to use a CSP or APSS subscription.

    若要取得識別碼,請登入 Azure,按一下 [所有服務]。To get the ID, sign in to Azure, click All services. 然後在 [一般] 分類底下,選取 [訂用帳戶],按一下您要使用的訂用帳戶,便可在 [基本資訊] 下找到 [訂用帳戶識別碼]。Then, under the GENERAL category, select Subscriptions, click the subscription you want to use, and under Essentials you can find the Subscription ID. 最佳做法是在生產環境和開發或測試環境中使用不同的訂用帳戶。As a best practice, use separate subscriptions for production and dev or test environments.
  • Azure 訂用帳戶的訂用帳戶 ID。The subscription ID for an Azure subscription. 僅支援 EA 訂用帳戶來進行註冊。Only EA subscriptions are supported for registration.

    若要取得識別碼,請登入 Azure,按一下 [所有服務]。To get the ID, sign in to Azure, click All services. 然後在 [一般] 分類底下,選取 [訂用帳戶],按一下您要使用的訂用帳戶,便可在 [基本資訊] 下找到 [訂用帳戶識別碼]。Then, under the GENERAL category, select Subscriptions, click the subscription you want to use, and under Essentials you can find the Subscription ID. 最佳做法是在生產環境和開發或測試環境中使用不同的訂用帳戶。As a best practice, use separate subscriptions for production and dev or test environments.

注意

目前不支援德國雲端訂用帳戶。Germany cloud subscriptions aren't currently supported.

  • 訂用帳戶擁有者的帳戶使用者名稱和密碼。The username and password for an account that's an owner for the subscription.

  • 使用者帳戶必須具有 Azure 訂用帳戶的存取權,而且有權在與該訂用帳戶相關聯的目錄中建立身分識別應用程式和服務主體。The user account needs to have access to the Azure subscription and have permissions to create identity apps and service principals in the directory associated with that subscription. 我們建議您使用最低限度的系統管理權向 Azure 註冊 Azure Stack Hub。We recommend that you register Azure Stack Hub with Azure using least-privilege administration. 如需深入了解如何建立自訂角色定義,以限制註冊時存取您訂用帳戶的權限,請參閱建立 Azure Stack Hub 的註冊角色For more information on how to create a custom role definition that limits access to your subscription for registration, see create a registration role for Azure Stack Hub.

  • 註冊 Azure Stack Hub 資源提供者 (請參閱後續的「註冊 Azure Stack Hub 資源提供者」一節以取得詳細資料)。Registered the Azure Stack Hub resource provider (see the following Register Azure Stack Hub Resource Provider section for details).

註冊之後,就不需要 Azure Active Directory (Azure AD) 全域管理員權限。After registration, Azure Active Directory (Azure AD) global administrator permission isn't required. 不過,某些作業可能需要全域管理員認證 (例如,需要獲派權限的資源提供者安裝程式指令碼或新功能)。However, some operations may require the global admin credential (for example, a resource provider installer script or a new feature requiring a permission to be granted). 您可以暫時恢復帳戶的全域管理員權限,或使用擁有「預設提供者訂用帳戶」的個別全域管理員帳戶。You can either temporarily reinstate the account's global admin permissions or use a separate global admin account that's an owner of the default provider subscription.

註冊 Azure Stack Hub 的使用者是 Azure AD 中服務主體的擁有者。The user who registers Azure Stack Hub is the owner of the service principal in Azure AD. 只有已註冊 Azure Stack Hub 的使用者可以修改 Azure Stack Hub 註冊。Only the user who registered Azure Stack Hub can modify the Azure Stack Hub registration. 如果不是註冊服務主體擁有者的非管理使用者嘗試註冊或重新註冊 Azure Stack Hub,則他們可能會收到 403 回應。If a non-admin user that's not an owner of the registration service principal attempts to register or re-register Azure Stack Hub, they may come across a 403 response. 403 回應表示使用者沒有足夠的權限可完成作業。A 403 response indicates the user has insufficient permissions to complete the operation.

如果您沒有符合這些需求的 Azure 訂用帳戶,則可以在這裡建立免費的 Azure 帳戶If you don't have an Azure subscription that meets these requirements, you can create a free Azure account here. 註冊 Azure Stack Hub 不會對您的 Azure 訂用帳戶收取任何費用。Registering Azure Stack Hub incurs no cost on your Azure subscription.

注意

如果您有多個 Azure Stack Hub,最佳做法是將每個 Azure Stack Hub 註冊到其自己的訂用帳戶。If you have more than one Azure Stack Hub, a best practice is to register each Azure Stack Hub to its own subscription. 這會讓您更輕鬆地追蹤使用情況。This makes it easier for you to track usage.

設定 PowerShell 語言模式Set the PowerShell language mode

若要成功註冊 Azure Stack Hub,PowerShell 語言模式必須設定為 FullLanguageModeTo successfully register Azure Stack Hub, the PowerShell language mode must be set to FullLanguageMode. 若要確認目前的語言模式是否已設定為完整,請開啟已提升權限的 PowerShell 視窗,然後執行下列 PowerShell Cmdlet:To verify that the current language mode is set to full, open an elevated PowerShell window and run the following PowerShell cmdlets:

$ExecutionContext.SessionState.LanguageMode

確定輸出有傳回 FullLanguageModeEnsure the output returns FullLanguageMode. 如果傳回任何其他語言模式,則必須在另一部機器上執行註冊,或必須將語言模式設定為 FullLanguageMode,才能繼續。If any other language mode is returned, registration needs to be run on another machine or the language mode needs to be set to FullLanguageMode before continuing.

安裝適用於 Azure Stack Hub 的 PowerShellInstall PowerShell for Azure Stack Hub

請使用適用於 Azure Stack Hub 的最新 PowerShell 向 Azure 註冊。Use the latest PowerShell for Azure Stack Hub to register with Azure.

如果尚未安裝最新版本,請參閱安裝適用於 Azure Stack Hub 的 PowerShellIf the latest version isn't already installed, see install PowerShell for Azure Stack Hub.

下載 Azure Stack Hub 工具Download the Azure Stack Hub tools

Azure Stack Hub 工具 GitHub 存放庫包含可支援 Azure Stack Hub 功能 (包括註冊功能) 的 PowerShell 模組。The Azure Stack Hub tools GitHub repository contains PowerShell modules that support Azure Stack Hub functionality, including registration functionality. 在註冊過程中,您必須匯入並使用 RegisterWithAzure.psm1 PowerShell 模組 (位於 Azure Stack Hub 工具存放庫中) 來向 Azure 註冊您的 Azure Stack Hub 執行個體。During the registration process, you need to import and use the RegisterWithAzure.psm1 PowerShell module (found in the Azure Stack Hub tools repository) to register your Azure Stack Hub instance with Azure.

為確保使用的是最新版本,請刪除任何現有的 Azure Stack Hub 工具版本,並從 GitHub 下載最新版本,再向 Azure 註冊。To ensure you're using the latest version, delete any existing versions of the Azure Stack Hub tools and download the latest version from GitHub before registering with Azure.

注意

您也可以使用「操作員存取工作站」 (OAW) 存取具特殊許可權的端點 (PEP) 、適用于支援案例的系統管理員入口網站,以及 Azure Stack Hub GitHub 工具。You can also use the The Operator Access Workstation (OAW) to access the privileged endpoint (PEP), the Administrator portal for support scenarios, and Azure Stack Hub GitHub Tools. 如需詳細資訊,請參閱 Azure Stack Hub 操作員存取工作站For more information see Azure Stack Hub Operator Access Workstation.

決定您的計費模型Determine your billing model

已連線的部署可讓 Azure Stack Hub 連線到網際網路和 Azure。A connected deployment allows Azure Stack Hub to connect to the internet, and to Azure. 您也可以使用 Azure AD 或 Active Directory 同盟服務 (AD FS) 作為身分識別存放區,並從兩種計費模型中做出選擇:隨用隨付或以容量為基礎。You can also use either Azure AD or Active Directory Federation Services (AD FS) as your identity store, and choose from two billing models: pay-as-you-use or capacity-based. 您稍後會在執行註冊指令碼時指定計費模型。You specify the billing model later, while running the registration script.

中斷連線的部署則可讓您使用 Azure Stack Hub,而不必連線到網際網路。A disconnected deployment allows you to use Azure Stack Hub without a connection to the internet. 若使用已中斷連線的部署,您會受限於 AD FS 身分識別儲存和以容量為基礎的計費模型。With a disconnected deployment, you're limited to an AD FS identity store and the capacity-based billing model. 您稍後會在執行註冊指令碼時指定計費模型。You specify the billing model later, while running the registration script.

決定唯一的註冊名稱Determine your unique registration name

執行註冊指令碼時,必須提供唯一的註冊名稱。When you run the registration script, you must provide a unique registration name. 讓 Azure Stack Hub 訂用帳戶與 Azure 註冊產生關聯的簡單方法,是使用您的 Azure Stack Hub 雲端識別碼An easy way to associate your Azure Stack Hub subscription with an Azure registration is to use your Azure Stack Hub Cloud ID.

注意

若 Azure Stack Hub 註冊使用容量型計費模型,在這些年度訂用帳戶到期之後,須於重新註冊時變更唯一名稱,除非您刪除過期的註冊並重新註冊 Azure。Azure Stack Hub registrations using the capacity-based billing model will need to change the unique name when re-registering after those yearly subscriptions expire unless you delete the expired registration and re-register with Azure.

若要判斷 Azure Stack Hub 部署的雲端識別碼,請參閱 尋找您的雲端識別碼To determine the Cloud ID for your Azure Stack Hub deployment, see Find your cloud ID.

使用隨用隨付計費進行註冊Register with pay-as-you-use billing

使用這些步驟,向 Azure 註冊「使用時付費」計費模型的 Azure Stack Hub。Use these steps to register Azure Stack Hub with Azure using the pay-as-you-use billing model.

注意

這些步驟全都必須從可存取具特殊權限端點 (PEP) 的電腦執行。All these steps must be run from a computer that has access to the privileged endpoint (PEP). 如需有關 PEP 的詳細資料,請參閱使用 Azure Stack Hub 中具有特殊權限的端點For details about the PEP, see Using the privileged endpoint in Azure Stack Hub.

已連線的環境可以存取網際網路和 Azure。Connected environments can access the internet and Azure. 在這類環境中,您必須向 Azure 註冊 Azure Stack Hub 資源提供者,然後設定計費模型。For these environments, you need to register the Azure Stack Hub resource provider with Azure and then configure your billing model.

  1. 若要向 Azure 註冊 Azure Stack Hub 資源提供者,請以系統管理員身分啟動 PowerShell ISE,然後使用下列 PowerShell Cmdlet,其中將 EnvironmentName 參數設定為適當的 Azure 訂用帳戶類型 (請參閱下面的參數)。To register the Azure Stack Hub resource provider with Azure, start PowerShell ISE as an administrator and use the following PowerShell cmdlets with the EnvironmentName parameter set to the appropriate Azure subscription type (see parameters below).

  2. 新增您用來註冊 Azure Stack Hub 的 Azure 帳戶。Add the Azure account that you used to register Azure Stack Hub. 若要新增帳戶,請執行 disconnect-azaccount Cmdlet。To add the account, run the Connect-AzAccount cmdlet. 當系統提示您輸入 Azure 帳戶認證時,您可能需要根據帳戶的組態使用雙因素驗證。You're prompted to enter your Azure account credentials and you may have to use two-factor authentication based on your account's configuration.

    Connect-AzAccount -EnvironmentName "<environment name>"
    
    參數Parameter 描述Description
    EnvironmentNameEnvironmentName Azure 雲端訂用帳戶環境名稱。The Azure cloud subscription environment name. 支援的環境名稱為 AzureCloudAzureUSGovernment,或如果使用中國 Azure 訂用帳戶,則為 AzureChinaCloudSupported environment names are AzureCloud, AzureUSGovernment, or if using a China Azure Subscription, AzureChinaCloud.

    注意

    如果您的會話已過期,您的密碼已變更,或您只是想要切換帳戶,請先執行下列 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 Connect-AzAccount: Remove-AzAccount-Scope Process

  3. 如果您有多個訂用帳戶,請執行下列命令以選取您要使用的訂用帳戶:If you have multiple subscriptions, run the following command to select the one you want to use:

    Get-AzSubscription -SubscriptionID '<Your Azure Subscription GUID>' | Select-AzSubscription
    
  4. 如需在您的 Azure 訂用帳戶中註冊 Azure Stack Hub 資源提供者,請執行下列命令:Run the following command to register the Azure Stack Hub resource provider in your Azure subscription:

    Register-AzResourceProvider -ProviderNamespace Microsoft.AzureStack
    
  5. 以系統管理員身分啟動 PowerShell ISE,然後流覽至您下載 Azure Stack Hub 工具時所建立的 AzureStack-Tools-az 目錄中的 註冊 資料夾。Start PowerShell ISE as an administrator and navigate to the Registration folder in the AzureStack-Tools-az directory created when you downloaded the Azure Stack Hub tools. 使用 PowerShell 匯入 RegisterWithAzure.psm1 模組:Import the RegisterWithAzure.psm1 module using PowerShell:

    Import-Module .\RegisterWithAzure.psm1
    
  6. 接下來,在相同的 PowerShell 工作階段中,確定您已登入正確的 Azure PowerShell 環境。Next, in the same PowerShell session, ensure you're signed in to the correct Azure PowerShell context. 此內容是先前用來註冊 Azure Stack Hub 資源提供者的 Azure 帳戶。This context would be the Azure account that was used to register the Azure Stack Hub resource provider previously. 要執行的 PowerShell:PowerShell to run:

    Connect-AzAccount -Environment "<environment name>"
    
    參數Parameter 描述Description
    EnvironmentNameEnvironmentName Azure 雲端訂用帳戶環境名稱。The Azure cloud subscription environment name. 支援的環境名稱為 AzureCloudAzureUSGovernment,或如果使用中國 Azure 訂用帳戶,則為 AzureChinaCloudSupported environment names are AzureCloud, AzureUSGovernment, or if using a China Azure Subscription, AzureChinaCloud.
  7. 在相同的 PowerShell 工作階段中,執行 Set-AzsRegistration Cmdlet。In the same PowerShell session, run the Set-AzsRegistration cmdlet. 要執行的 PowerShell:PowerShell to run:

    $CloudAdminCred = Get-Credential -UserName <Privileged endpoint credentials> -Message "Enter the cloud domain credentials to access the privileged endpoint."
    $RegistrationName = "<unique-registration-name>"
    Set-AzsRegistration `
       -PrivilegedEndpointCredential $CloudAdminCred `
       -PrivilegedEndpoint <PrivilegedEndPoint computer name> `
       -BillingModel PayAsYouUse `
       -RegistrationName $RegistrationName
    

    如需有關 Set-AzsRegistration Cmdlet 的詳細資訊,請參閱註冊參考For more information on the Set-AzsRegistration cmdlet, see Registration reference.

此程序需要 10 到 15 分鐘的時間。The process takes between 10 and 15 minutes. 命令完成時,您會看到 「您的環境現在已使用提供的參數註冊並啟動」 的訊息。When the command completes, you see the message "Your environment is now registered and activated using the provided parameters."

使用容量計費進行註冊Register with capacity billing

使用這些步驟,向 Azure 註冊容量計費模型的 Azure Stack Hub。Use these steps to register Azure Stack Hub with Azure using the capacity billing model.

注意

這些步驟全都必須從可存取具特殊權限端點 (PEP) 的電腦執行。All these steps must be run from a computer that has access to the privileged endpoint (PEP). 如需有關 PEP 的詳細資料,請參閱使用 Azure Stack Hub 中具有特殊權限的端點For details about the PEP, see Using the privileged endpoint in Azure Stack Hub.

已連線的環境可以存取網際網路和 Azure。Connected environments can access the internet and Azure. 在這類環境中,您必須向 Azure 註冊 Azure Stack Hub 資源提供者,然後設定計費模型。For these environments, you need to register the Azure Stack Hub resource provider with Azure and then configure your billing model.

  1. 若要向 Azure 註冊 Azure Stack Hub 資源提供者,請以系統管理員身分啟動 PowerShell ISE,然後使用下列 PowerShell Cmdlet,其中將 EnvironmentName 參數設定為適當的 Azure 訂用帳戶類型 (請參閱下面的參數)。To register the Azure Stack Hub resource provider with Azure, start PowerShell ISE as an administrator and use the following PowerShell cmdlets with the EnvironmentName parameter set to the appropriate Azure subscription type (see parameters below).

  2. 新增您用來註冊 Azure Stack Hub 的 Azure 帳戶。Add the Azure account that you used to register Azure Stack Hub. 若要新增帳戶,請執行 disconnect-azaccount Cmdlet。To add the account, run the Connect-AzAccount cmdlet. 當系統提示您輸入 Azure 帳戶認證時,您可能需要根據帳戶的組態使用雙因素驗證。You're prompted to enter your Azure account credentials and you may have to use two-factor authentication based on your account's configuration.

    Connect-AzAccount -Environment "<environment name>"
    
    參數Parameter 描述Description
    EnvironmentNameEnvironmentName Azure 雲端訂用帳戶環境名稱。The Azure cloud subscription environment name. 支援的環境名稱為 AzureCloudAzureUSGovernment,或如果使用中國 Azure 訂用帳戶,則為 AzureChinaCloudSupported environment names are AzureCloud, AzureUSGovernment, or if using a China Azure Subscription, AzureChinaCloud.
  3. 如果您有多個訂用帳戶,請執行下列命令以選取您要使用的訂用帳戶:If you have multiple subscriptions, run the following command to select the one you want to use:

    Get-AzSubscription -SubscriptionID '<Your Azure Subscription GUID>' | Select-AzSubscription
    
  4. 如需在您的 Azure 訂用帳戶中註冊 Azure Stack Hub 資源提供者,請執行下列命令:Run the following command to register the Azure Stack Hub resource provider in your Azure subscription:

    Register-AzResourceProvider -ProviderNamespace Microsoft.AzureStack
    
  5. 以系統管理員身分啟動 PowerShell ISE,然後流覽至您下載 Azure Stack Hub 工具時所建立的 AzureStack-Tools-az 目錄中的 註冊 資料夾。Start PowerShell ISE as an administrator and navigate to the Registration folder in the AzureStack-Tools-az directory created when you downloaded the Azure Stack Hub tools. 使用 PowerShell 匯入 RegisterWithAzure.psm1 模組:Import the RegisterWithAzure.psm1 module using PowerShell:

    $CloudAdminCred = Get-Credential -UserName <Privileged endpoint credentials> -Message "Enter the cloud domain credentials to access the privileged endpoint."
    $RegistrationName = "<unique-registration-name>"
    Set-AzsRegistration `
       -PrivilegedEndpointCredential $CloudAdminCred `
       -PrivilegedEndpoint <PrivilegedEndPoint computer name> `
       -AgreementNumber <EA agreement number> `
       -BillingModel Capacity `
       -RegistrationName $RegistrationName
    

    注意

    您可以將參數設為 false,以此方式使用 Set-AzsRegistration Cmdlet 的 UsageReportingEnabled 參數來停用使用量報告功能。You can disable usage reporting with the UsageReportingEnabled parameter for the Set-AzsRegistration cmdlet by setting the parameter to false.

    如需有關 Set-AzsRegistration Cmdlet 的詳細資訊,請參閱註冊參考For more information on the Set-AzsRegistration cmdlet, see Registration reference.

使用容量計費進行註冊Register with capacity billing

如果您要在中斷連線的環境中 (沒有網際網路連線) 註冊 Azure Stack Hub,您需要從 Azure Stack Hub 環境取得註冊權杖。If you're registering Azure Stack Hub in a disconnected environment (with no internet connectivity), you need to get a registration token from the Azure Stack Hub environment. 然後只要電腦已連線到 Azure 且已安裝適用於 Azure Stack Hub 的 PowerShell,即可使用該權杖。Then use that token on a computer that can connect to Azure and has PowerShell for Azure Stack Hub installed.

從 Azure Stack Hub 環境中取得註冊權杖Get a registration token from the Azure Stack Hub environment

  1. 以系統管理員身分啟動 PowerShell ISE,然後流覽至您下載 Azure Stack Hub 工具時所建立的 AzureStack-Tools-az 目錄中的 註冊 資料夾。Start PowerShell ISE as an administrator and navigate to the Registration folder in the AzureStack-Tools-az directory created when you downloaded the Azure Stack Hub tools. 匯入 RegisterWithAzure.psm1 模組:Import the RegisterWithAzure.psm1 module:

    Import-Module .\RegisterWithAzure.psm1
    
  2. 若要取得註冊權杖,請執行下列 PowerShell Cmdlet:To get the registration token, run the following PowerShell cmdlets:

    $FilePathForRegistrationToken = "$env:SystemDrive\RegistrationToken.txt"
    $RegistrationToken = Get-AzsRegistrationToken -PrivilegedEndpointCredential $YourCloudAdminCredential -UsageReportingEnabled:$False -PrivilegedEndpoint $YourPrivilegedEndpoint -BillingModel Capacity -AgreementNumber '<EA agreement number>' -TokenOutputFilePath $FilePathForRegistrationToken
    

    如需有關 Get-AzsRegistrationToken Cmdlet 的詳細資訊,請參閱註冊參考For more information on the Get-AzsRegistrationToken cmdlet, see Registration reference.

    提示

    註冊權杖會儲存在針對 $FilePathForRegistrationToken 指定的檔案。The registration token is saved in the file specified for $FilePathForRegistrationToken. 您可以自行變更檔案路徑或檔名。You can change the filepath or filename at your discretion.

  3. 儲存此註冊權杖,以在連線 Azure 的機器上使用。Save this registration token for use on the Azure-connected machine. 您可以從 $FilePathForRegistrationToken 複製檔案或文字。You can copy the file or the text from $FilePathForRegistrationToken.

連線至 Azure 並註冊Connect to Azure and register

在連線至網際網路的電腦上,執行相同的步驟,以匯入 RegisterWithAzure.psm1 模組,並登入正確的 Azure PowerShell 環境。On the computer that is connected to the internet, do the same steps to import the RegisterWithAzure.psm1 module and sign in to the correct Azure PowerShell context. 接著,呼叫 Register-AzsEnvironment。Then call Register-AzsEnvironment. 指定要向 Azure 註冊的註冊權杖。Specify the registration token to register with Azure. 如果您要使用相同的 Azure 訂用帳戶識別碼註冊多個 Azure Stack Hub 執行個體,請指定一個唯一的註冊名稱。If you're registering more than one instance of Azure Stack Hub using the same Azure Subscription ID, specify a unique registration name.

您會需要註冊權杖與唯一的權杖名稱。You need your registration token and a unique token name.

  1. 以系統管理員身分啟動 PowerShell ISE,然後流覽至您下載 Azure Stack Hub 工具時所建立的 AzureStack-Tools-az 目錄中的 註冊 資料夾。Start PowerShell ISE as an administrator and navigate to the Registration folder in the AzureStack-Tools-az directory created when you downloaded the Azure Stack Hub tools. 匯入 RegisterWithAzure.psm1 模組:Import the RegisterWithAzure.psm1 module:

    Import-Module .\RegisterWithAzure.psm1
    
  2. 然後執行下列 PowerShell Cmdlet:Then run the following PowerShell cmdlets:

    $RegistrationToken = "<Your Registration Token>"
    $RegistrationName = "<unique-registration-name>"
    Register-AzsEnvironment -RegistrationToken $RegistrationToken -RegistrationName $RegistrationName
    

(選擇性) 您可以使用 Get-content cmdlet 來指向包含您註冊權杖的檔案。Optionally, you can use the Get-Content cmdlet to point to a file that contains your registration token.

您會需要註冊權杖與唯一的權杖名稱。You need your registration token and a unique token name.

  1. 以系統管理員身分啟動 PowerShell ISE,然後流覽至您下載 Azure Stack Hub 工具時所建立的 AzureStack-Tools-az 目錄中的 註冊 資料夾。Start PowerShell ISE as an administrator and navigate to the Registration folder in the AzureStack-Tools-az directory created when you downloaded the Azure Stack Hub tools. 匯入 RegisterWithAzure.psm1 模組:Import the RegisterWithAzure.psm1 module:

    Import-Module .\RegisterWithAzure.psm1
    
  2. 然後執行下列 PowerShell Cmdlet:Then run the following PowerShell cmdlets:

    $RegistrationToken = Get-Content -Path '<Path>\<Registration Token File>'
    Register-AzsEnvironment -RegistrationToken $RegistrationToken -RegistrationName $RegistrationName
    

注意

儲存註冊資源名稱和註冊權杖,供日後參考。Save the registration resource name and the registration token for future reference.

從 Azure 註冊資源擷取啟用金鑰Retrieve an Activation Key from Azure Registration Resource

接著,進行 Register-AzsEnvironment 時,您必須從 Azure 中建立的註冊資源中擷取啟用金鑰。Next, you need to retrieve an activation key from the registration resource created in Azure during Register-AzsEnvironment.

若要取得啟用金鑰,請執行下列 PowerShell Cmdlet:To get the activation key, run the following PowerShell cmdlets:

$RegistrationResourceName = "<unique-registration-name>"
$KeyOutputFilePath = "$env:SystemDrive\ActivationKey.txt"
$ActivationKey = Get-AzsActivationKey -RegistrationName $RegistrationResourceName -KeyOutputFilePath $KeyOutputFilePath

提示

啟用金鑰會儲存在為 $KeyOutputFilePath 指定的檔案中。The activation key is saved in the file specified for $KeyOutputFilePath. 您可以自行變更檔案路徑或檔名。You can change the filepath or filename at your discretion.

在 Azure Stack Hub 中建立啟用資源Create an Activation Resource in Azure Stack Hub

從 Get-AzsActivationKey 建立的啟用金鑰中取得檔案或文字後,返回 Azure Stack Hub 環境。Return to the Azure Stack Hub environment with the file or text from the activation key created from Get-AzsActivationKey. 接下來,您將使用該啟用金鑰在 Azure Stack Hub 中建立啟用資源。Next create an activation resource in Azure Stack Hub using that activation key. 若要建立啟用資源,請執行下列 PowerShell Cmdlet:To create an activation resource, run the following PowerShell cmdlets:

$ActivationKey = "<activation key>"
New-AzsActivationResource -PrivilegedEndpointCredential $YourCloudAdminCredential -PrivilegedEndpoint $YourPrivilegedEndpoint -ActivationKey $ActivationKey

(選擇性) 您可以使用 Get-content cmdlet 來指向包含您註冊權杖的檔案:Optionally, you can use the Get-Content cmdlet to point to a file that contains your registration token:

$ActivationKey = Get-Content -Path '<Path>\<Activation Key File>'
New-AzsActivationResource -PrivilegedEndpointCredential $YourCloudAdminCredential -PrivilegedEndpoint $YourPrivilegedEndpoint -ActivationKey $ActivationKey

驗證 Azure Stack Hub 註冊Verify Azure Stack Hub registration

您可以使用 [區域管理] 圖格來確認 Azure Stack Hub 註冊是否已成功。You can use the Region management tile to verify that the Azure Stack Hub registration was successful. 此圖格位於系統管理員入口網站中的預設儀表板上。This tile is available on the default dashboard in the administrator portal. 狀態可以是已註冊或未註冊。The status can be registered, or not registered. 如果是已註冊,則會一併顯示您用來註冊 Azure Stack Hub 的 Azure 訂用帳戶 ID,以及註冊資源群組和名稱。If registered, it also shows the Azure subscription ID that you used to register your Azure Stack Hub along with the registration resource group and name.

  1. 登入 Azure Stack Hub 系統管理員入口網站 https://adminportal.local.azurestack.externalSign in to the Azure Stack Hub administrator portal https://adminportal.local.azurestack.external.

  2. 從儀表板中,選取 [Region management] (區域管理)。From the Dashboard, select Region management.

  3. 選取 [屬性] 。Select Properties. 此刀鋒視窗會顯示您環境的狀態和詳細資料。This blade shows the status and details of your environment. 狀態可以是 [已註冊]、[未註冊] 或 [已過期]。The status can be Registered, Not registered, or Expired.

    Azure Stack Hub 管理員入口網站中的區域管理圖格Region management tile in Azure Stack Hub administrator portal

    若已註冊,屬性會包括:If registered, the properties include:

    • 註冊訂用帳戶識別碼:已註冊並且與 Azure Stack Hub 相關聯的 Azure 訂用帳戶識別碼。Registration subscription ID: The Azure subscription ID registered and associated to Azure Stack Hub.
    • 註冊資源群組: 相關聯的訂用帳戶中包含 Azure Stack Hub 資源的 Azure 資源群組。Registration resource group: The Azure resource group in the associated subscription containing the Azure Stack Hub resources.
  4. 您可以使用 Azure 入口網站來檢視 Azure Stack Hub 註冊資源,然後確認註冊是否成功。You can use the Azure portal to view Azure Stack Hub registration resources, and then verify that the registration succeeded. 使用與您用來註冊 Azure Stack Hub 的訂用帳戶相關聯的帳戶,登入 Azure 入口網站Sign in to the Azure portal using an account associated to the subscription you used to register Azure Stack Hub. 選取 [所有資源]啟用 [顯示隱藏的類型] 核取方塊,然後選取註冊名稱。Select All resources, enable the Show hidden types checkbox, and select the registration name.

  5. 如果註冊不成功,您必須遵循這裡的步驟來重新註冊,進而解決問題。If the registration didn't succeed, you must re-register by following the steps here to resolve the issue.

或者,您也可以使用 Marketplace 管理功能來確認註冊是否已成功。Alternatively, you can verify if your registration was successful by using the Marketplace management feature. 如果您在 [Marketplace 管理] 刀鋒視窗中看到 Marketplace 項目清單,即表示您的註冊已成功。If you see a list of marketplace items in the Marketplace management blade, your registration was successful. 不過,在已中斷連線的環境中,您則無法在 Marketplace 管理中看到 Marketplace 項目。However, in disconnected environments, you can't see marketplace items in Marketplace management.

注意

註冊完成後,就不會再出現未註冊的作用中警告。After registration is complete, the active warning for not registering will no longer appear. 在早於 1904 的 Azure Stack Hub 版本中,已中斷連線的情況下,即使您已成功註冊,在 Marketplace 管理中,仍然會看到要求您註冊並啟用 Azure Stack Hub 的訊息。In Azure Stack Hub releases before 1904, in disconnected scenarios, you see a message in Marketplace management asking you to register and activate your Azure Stack Hub, even if you have registered successfully. 此訊息不會出現在 1904 版和更新版本中。This message doesn't appear in release 1904 and later.

續訂或變更註冊Renew or change registration

在下列情況下,您必須更新您的註冊:You need to update your registration in the following circumstances:

  • 在您續訂以容量為基礎的年度訂用帳戶之後。After you renew your capacity-based yearly subscription.
  • 當您變更計費模型時。When you change your billing model.
  • 當您調整以容量為基礎的計費變更 (新增/移除節點) 時。When you scale changes (add/remove nodes) for capacity-based billing.

必要條件Prerequisites

您在管理員入口網站中必須要有下列資訊,才能續訂或變更註冊:You need the following information from the administrator portal to renew or change registration:

系統管理員入口網站Administrator portal Cmdlet 參數Cmdlet parameter 注意Notes
註冊訂用帳戶識別碼REGISTRATION SUBSCRIPTION ID 訂用帳戶Subscription 先前註冊期間使用的訂用帳戶識別碼Subscription ID used during previous registration
註冊資源群組REGISTRATION RESOURCE GROUP resourceGroupNameResourceGroupName 先前的註冊資源所在的資源群組Resource group under which the previous registration resource exists
註冊名稱REGISTRATION NAME RegistrationNameRegistrationName 先前註冊期間使用的註冊名稱Registration name used during previous registration

變更您使用的訂用帳戶Change the subscription you use

如果要變更您所使用的訂用帳戶,就必須先執行 Remove-AzsRegistration Cmdlet,然後確保您已登入正確的 Azure PowerShell 內容。If you want to change the subscription you use, you must first run the Remove-AzsRegistration cmdlet, then ensure you're signed in to the correct Azure PowerShell context. 然後,使用任何已變更的參數 (包括 <billing model>) 來執行 Set-AzsRegistrationThen run Set-AzsRegistration with any changed parameters, including <billing model>. 執行 Remove-AzsRegistration 時,您必須登入在註冊期間使用的訂用帳戶,並使用 管理員入口網站中顯示的 RegistrationNameResourceGroupName 參數值:While running Remove-AzsRegistration, you must be signed in to the subscription used during the registration and use values of the RegistrationName and ResourceGroupName parameters as shown in the administrator portal:

# select the subscription used during the registration (shown in portal)
Select-AzSubscription -Subscription '<Registration subscription ID from portal>'
# unregister using the parameter values from portal
Remove-AzsRegistration -PrivilegedEndpointCredential $YourCloudAdminCredential -PrivilegedEndpoint $YourPrivilegedEndpoint -RegistrationName '<Registration name from portal>' -ResourceGroupName '<Registration resource group from portal>'
# switch to new subscription id
Select-AzSubscription -Subscription '<New subscription ID>'
# register 
Set-AzsRegistration -PrivilegedEndpointCredential $YourCloudAdminCredential -PrivilegedEndpoint $YourPrivilegedEndpoint -BillingModel '<Billing model>' -RegistrationName '<Registration name>' -ResourceGroupName '<Registration resource group name>'

變更計費模型、功能的提供方式,或重新註冊您的執行個體Change billing model, how features are offered, or re-register your instance

如果您想要變更計費模型、功能的提供方式,或想要重新註冊執行個體,請參考本節的內容。This section applies if you want to change the billing model, how features are offered, or you want to re-register your instance. 對於前述各種案例,您都可以呼叫註冊函式以設定新值。For all of these cases, you call the registration function to set the new values. 您不需要先移除目前的註冊。You don't need to first remove the current registration. 登入管理員入口網站中顯示的訂用帳戶識別碼,然後使用新的 BillingModel 值 (但保留管理員入口網站中顯示的相同 RegistrationNameResourceGroupName 參數值) 重新執行註冊:Sign in to the subscription ID shown in the administrator portal, and then rerun registration with a new BillingModel value while keeping the RegistrationName and ResourceGroupName parameters values same as shown in the administrator portal:

# select the subscription used during the registration
Select-AzSubscription -Subscription '<Registration subscription ID from portal>'
# rerun registration with new BillingModel (or same billing model in case of re-registration) but using other parameters values from portal
Set-AzsRegistration -PrivilegedEndpointCredential $YourCloudAdminCredential -PrivilegedEndpoint $YourPrivilegedEndpoint -BillingModel '<New billing model>' -RegistrationName '<Registration name from portal>' -ResourceGroupName '<Registration resource group from portal>'

在下列情況下,您需要更新或續訂您的註冊:You need to update or renew your registration in the following circumstances:

  • 在您續訂以容量為基礎的年度訂用帳戶之後。After you renew your capacity-based yearly subscription.
  • 當您變更計費模型時。When you change your billing model.
  • 當您調整以容量為基礎的計費變更 (新增/移除節點) 時。When you scale changes (add/remove nodes) for capacity-based billing.

從 Azure Stack Hub 中移除啟用資源Remove the activation resource from Azure Stack Hub

您必須先從 Azure Stack Hub 中移除啟用資源,然後再移除 Azure 中的註冊資源。You first need to remove the activation resource from Azure Stack Hub, and then the registration resource in Azure.

若要移除 Azure Stack Hub 中的啟用資源,請在您的 Azure Stack Hub 環境中執行下列 PowerShell Cmdlet:To remove the activation resource in Azure Stack Hub, run the following PowerShell cmdlets in your Azure Stack Hub environment:

Remove-AzsActivationResource -PrivilegedEndpointCredential $YourCloudAdminCredential -PrivilegedEndpoint $YourPrivilegedEndpoint

接下來,若要移除 Azure 中的註冊資源,請確定您的電腦已與 Azure 連線,然後登入正確的 Azure PowerShell 環境,並執行適當的 PowerShell Cmdlet,如下所述。Next, to remove the registration resource in Azure, ensure you're on an Azure-connected computer, sign in to the correct Azure PowerShell context, and run the appropriate PowerShell cmdlets as described below.

您可以使用用來建立資源的註冊權杖:You can use the registration token used to create the resource:

$RegistrationToken = "<registration token>"
Unregister-AzsEnvironment -RegistrationToken $RegistrationToken

或者,您可以使用管理員入口網站中的註冊名稱和註冊資源群組名稱:Or you can use the registration name and registration resource group name from the administrator portal:

Unregister-AzsEnvironment -RegistrationName '<Registration name from portal>' -ResourceGroupName '<Registration resource group from portal>'

使用已連線的步驟重新註冊Re-register using connected steps

如果將計費模型從已中斷連線狀態的容量計費變更為已連線狀態的耗用量計費,則請遵循已連線模型的步驟來重新註冊。If changing your billing model from capacity billing in a disconnected state to consumption billing in a connected state, you will re-register following the connected model steps.

注意

這不會變更您的身分識別模型,只會變更計費機制,而您仍會使用 AD FS 作為身分識別來源。This does not change your identity model, only the billing mechanism, and you will still use AD FS as your identity source.

使用未連線的步驟重新註冊Re-register using disconnected steps

您現在已在未連線的狀況下完成取消註冊,而您必須在未連線的狀況下,執行重複的步驟來註冊 Azure Stack Hub 環境。You've now completely unregistered in a disconnected scenario and must repeat the steps for registering an Azure Stack Hub environment in a disconnected scenario.

停用或啟用使用量報告功能Disable or enable usage reporting

針對使用容量計費模型的 Azure Stack Hub 環境,請使用 Set-AzsRegistrationGet-AzsRegistrationToken Cmdlet 搭配 UsageReportingEnabled 參數來關閉使用量報告功能。For Azure Stack Hub environments that use a capacity billing model, turn off usage reporting with the UsageReportingEnabled parameter using either the Set-AzsRegistration or the Get-AzsRegistrationToken cmdlets. Azure Stack Hub 預設會回報使用計量。Azure Stack Hub reports usage metrics by default. 操作員若使用容量或支援已中斷連線的環境,將必須關閉使用量報告功能。Operators with capacity uses or supporting a disconnected environment need to turn off usage reporting.

執行下列 PowerShell Cmdlet:Run the following PowerShell cmdlets:

$CloudAdminCred = Get-Credential -UserName <Privileged endpoint credentials> -Message "Enter the cloud domain credentials to access the privileged endpoint."
$RegistrationName = "<unique-registration-name>"
Set-AzsRegistration `
   -PrivilegedEndpointCredential $CloudAdminCred `
   -PrivilegedEndpoint <PrivilegedEndPoint computer name> `
   -BillingModel Capacity
   -RegistrationName $RegistrationName
   -UsageReportingEnabled:$false
  1. 若要變更註冊權杖,請執行下列 PowerShell Cmdlet:To change the registration token, run the following PowerShell cmdlets:

    $FilePathForRegistrationToken = $env:SystemDrive\RegistrationToken.txt
    $RegistrationToken = Get-AzsRegistrationToken -PrivilegedEndpointCredential -UsageReportingEnabled:$False
    $YourCloudAdminCredential -PrivilegedEndpoint $YourPrivilegedEndpoint -BillingModel Capacity -AgreementNumber '<EA agreement number>' -TokenOutputFilePath $FilePathForRegistrationToken
    

    提示

    註冊權杖會儲存在針對 $FilePathForRegistrationToken 指定的檔案。The registration token is saved in the file specified for $FilePathForRegistrationToken. 您可以自行變更檔案路徑或檔名。You can change the filepath or filename at your discretion.

  2. 儲存此註冊權杖,以在連線 Azure 的電腦上使用。Save this registration token for use on the Azure connected machine. 您可以從 $FilePathForRegistrationToken 複製檔案或文字。You can copy the file or the text from $FilePathForRegistrationToken.

移動註冊資源Move a registration resource

對於所有環境均 支援 在相同的訂用帳戶下的資源群組之間移動註冊資源。Moving a registration resource between resource groups under the same subscription is supported for all environments. 不過,如果兩個訂用帳戶解析為相同的合作夥伴識別碼,則僅針對 CSP 支援在訂用帳戶之間移動註冊資源。However, moving a registration resource between subscriptions is only supported for CSPs when both subscriptions resolve to the same Partner ID. 如需將資源移到新資源群組的詳細資訊,請參閱將資源移到新的資源群組或訂用帳戶For more information about moving resources to a new resource group, see Move resources to new resource group or subscription.

重要

若要防止在入口網站上意外刪除註冊資源,註冊指令碼會將鎖定自動新增至資源。To prevent accidental deletion of registration resources on the portal, the registration script automatically adds a lock to the resource. 您必須先移除此鎖定,才能加以移動或刪除。You must remove this lock before moving or deleting it. 建議您將鎖定新增至您的註冊資源,以防止意外刪除。It's recommended that you add a lock to your registration resource to prevent accidental deletion.

註冊參考Registration reference

Set-AzsRegistrationSet-AzsRegistration

您可以使用 Set-AzsRegistration 向 Azure 註冊 Azure Stack Hub,以及啟用或停用在市集中提供項目的功能和使用量報告功能。You can use Set-AzsRegistration to register Azure Stack Hub with Azure and enable or disable the offer of items in the marketplace and usage reporting.

若要執行此 Cmdlet,您需要:To run the cmdlet, you need:

  • 一個任何類型的全域 Azure 訂用帳戶。A global Azure subscription of any type.
  • 使用該訂用帳戶擁有者或參與者身分的帳戶來登入 Azure PowerShell。To be signed in to Azure PowerShell with an account that's an owner or contributor to that subscription.
Set-AzsRegistration [-PrivilegedEndpointCredential] <PSCredential> [-PrivilegedEndpoint] <String> [[-AzureContext]
    <PSObject>] [[-ResourceGroupName] <String>] [[-ResourceGroupLocation] <String>] [[-BillingModel] <String>]
    [-MarketplaceSyndicationEnabled] [-UsageReportingEnabled] [[-AgreementNumber] <String>] [[-RegistrationName]
    <String>] [<CommonParameters>]
參數Parameter 類型Type 描述Description
PrivilegedEndpointCredentialPrivilegedEndpointCredential PSCredentialPSCredential 用來存取具有特殊權限的端點的認證。The credentials used to access the privileged endpoint. 使用者名稱的格式為 AzureStackDomain\CloudAdminThe username is in the format AzureStackDomain\CloudAdmin.
PrivilegedEndpointPrivilegedEndpoint StringString 一個預先設定的遠端 PowerShell 主控台,可為您提供記錄收集和其他後續部署工作之類的功能。A pre-configured remote PowerShell console that provides you with capabilities like log collection and other post deployment tasks. 若要深入了解,請參閱使用具有特殊權限的端點一文。To learn more, refer to the using the privileged endpoint article.
AzureContextAzureContext PSObjectPSObject
resourceGroupNameResourceGroupName StringString
ResourceGroupLocationResourceGroupLocation StringString
BillingModelBillingModel StringString 您的訂用帳戶所使用的計費模型。The billing model that your subscription uses. 此參數允許的值:Capacity、PayAsYouUse 和 Development。Allowed values for this parameter are: Capacity, PayAsYouUse, and Development.
MarketplaceSyndicationEnabledMarketplaceSyndicationEnabled True/FalseTrue/False 判斷是否可在入口網站中使用 Marketplace 管理功能。Determines if the marketplace management feature is available in the portal. 如果在有網際網路連線的情況下註冊,則設定為 True。Set to true if registering with internet connectivity. 如果在已中斷連線的環境中註冊,則設定為 False。Set to false if registering in disconnected environments. 若為中斷連線的註冊,離線摘要整合工具可用於下載 Marketplace 項目。For disconnected registrations, the offline syndication tool can be used for downloading marketplace items.
UsageReportingEnabledUsageReportingEnabled True/FalseTrue/False Azure Stack Hub 預設會回報使用計量。Azure Stack Hub reports usage metrics by default. 操作員若使用容量或支援已中斷連線的環境,將必須關閉使用量報告功能。Operators with capacity uses or supporting a disconnected environment need to turn off usage reporting. 此參數允許的值:True、False。Allowed values for this parameter are: True, False.
AgreementNumberAgreementNumber StringString 用來排序此 Azure Stack 容量 SKU 的 EA 合約編號。The number of the EA agreement under which the Capacity SKU for this Azure Stack was ordered.
RegistrationNameRegistrationName StringString 如果您要在多個 Azure Stack Hub 執行個體上,使用相同的 Azure 訂用帳戶識別碼執行註冊指令碼,請為註冊設定唯一的名稱。Set a unique name for the registration if you're running the registration script on more than one instance of Azure Stack Hub using the same Azure Subscription ID. 此參數的預設值是 AzureStackRegistrationThe parameter has a default value of AzureStackRegistration. 不過,如果您在多個 Azure Stack Hub 執行個體上使用相同的名稱,指令碼將會失敗。However, if you use the same name on more than one instance of Azure Stack Hub, the script fails.

Get-AzsRegistrationTokenGet-AzsRegistrationToken

Get-AzsRegistrationToken 會從輸入參數產生註冊權杖。Get-AzsRegistrationToken generates a registration token from the input parameters.

Get-AzsRegistrationToken [-PrivilegedEndpointCredential] <PSCredential> [-PrivilegedEndpoint] <String>
    [-BillingModel] <String> [[-TokenOutputFilePath] <String>] [-UsageReportingEnabled] [[-AgreementNumber] <String>]
    [<CommonParameters>]
參數Parameter 類型Type 描述Description
PrivilegedEndpointCredentialPrivilegedEndpointCredential PSCredentialPSCredential 用來存取具有特殊權限的端點的認證。The credentials used to access the privileged endpoint. 使用者名稱的格式為 AzureStackDomain\CloudAdminThe username is in the format AzureStackDomain\CloudAdmin.
PrivilegedEndpointPrivilegedEndpoint StringString 一個預先設定的遠端 PowerShell 主控台,可為您提供記錄收集和其他後續部署工作之類的功能。A pre-configured remote PowerShell console that provides you with capabilities like log collection and other post deployment tasks. 若要深入了解,請參閱使用具有特殊權限的端點一文。To learn more, refer to the using the privileged endpoint article.
AzureContextAzureContext PSObjectPSObject
resourceGroupNameResourceGroupName StringString
ResourceGroupLocationResourceGroupLocation StringString
BillingModelBillingModel StringString 您的訂用帳戶所使用的計費模型。The billing model that your subscription uses. 此參數允許的值:Capacity、PayAsYouUse 和 Development。Allowed values for this parameter are: Capacity, PayAsYouUse, and Development.
MarketplaceSyndicationEnabledMarketplaceSyndicationEnabled True/FalseTrue/False
UsageReportingEnabledUsageReportingEnabled True/FalseTrue/False Azure Stack Hub 預設會回報使用計量。Azure Stack Hub reports usage metrics by default. 操作員若使用容量或支援已中斷連線的環境,將必須關閉使用量報告功能。Operators with capacity uses or supporting a disconnected environment need to turn off usage reporting. 此參數允許的值:True、False。Allowed values for this parameter are: True, False.
AgreementNumberAgreementNumber StringString

註冊失敗Registration failures

嘗試註冊 Azure Stack Hub 時,您可能會看到下列其中一種錯誤:You might see one of the errors below while attempting to register your Azure Stack Hub:

  • 無法擷取 $hostName 的必要硬體資訊。Could not retrieve mandatory hardware info for $hostName. 請檢查實體主機和連線能力,然後嘗試重新執行註冊。Check physical host and connectivity, then try to rerun registration.

  • 無法連線至 $hostName 以取得硬體資訊。Cannot connect to $hostName to get hardware info. 請檢查實體主機和連線能力,然後嘗試重新執行註冊。Check physical host and connectivity, then try to rerun registration.

    原因:這通常是因為我們試著從主機取得硬體詳細資料 (例如 UUID、Bios 和 CPU) 來進行啟用,但因為無法連線到實體主機而失敗。Cause: this is typically because we try to obtain hardware details such as UUID, Bios, and CPU from the hosts to attempt activation and weren't able to due to the inability to connect to the physical host.

  • 雲端識別碼 [GUID] 已註冊。Cloud identifier [GUID] is already registered. 不允許重複使用雲端識別碼。Reusing cloud identifiers is not allowed.

    原因:如果您的 Azure Stack 環境已註冊,就會發生此狀況。Cause: this happens if your Azure Stack environment is already registered. 如果您想要使用不同的訂用帳戶或計費模型來重新註冊環境,請遵循續訂或變更註冊的步驟If you want to re-register your environment with a different subscription or billing model, follow the Renew or change registration steps.

  • 存取 Marketplace 管理時,當您嘗試同步發佈產品時發生錯誤。When trying to access Marketplace management, an error occurs when trying to syndicate products.

    原因:這通常會在 Azure Stack Hub 無法存取註冊資源時發生。Cause: this usually happens when Azure Stack Hub is unable to access the registration resource. 常見的原因是,Azure 訂用帳戶的目錄租用戶發生變更,因而重設註冊。One common reason for this is that when an Azure subscription's directory tenant changes, it resets the registration. 如果您變更了訂用帳戶的目錄租用戶,您將無法存取 Azure Stack Hub Marketplace 或使用報表。You can't access the Azure Stack Hub Marketplace or report usage if you've changed the subscription's directory tenant. 您需要重新註冊來修正此問題。You need to re-register to fix this issue.

  • 即使您已使用中斷連線的處理程序來註冊戳記,Marketplace 管理仍會要求您註冊並啟用 Azure Stack Hub。Marketplace management still asks you to register and activate your Azure Stack Hub even when you've already registered your stamp using the disconnected process.

    原因:這是已中斷連線環境的已知問題,因此您必須確認註冊狀態Cause: this is a known issue for disconnected environments, and requires you to verify your registration status. 若要使用 Marketplace 管理,請使用離線工具In order to use Marketplace management, use the offline tool.

後續步驟Next steps

從 Azure 下載市集項目Download marketplace items from Azure