共用方式為


停用 Azure Stack Hub 系統

本文說明如何正確退役 Azure Stack Hub 系統。 在收回系統硬體之前,請遵循此流程,以確保租戶負載安全,移除敏感資訊,並從 Azure 取消註冊系統。

先決條件

開始之前,請確定符合下列必要條件:

  • 請確定已從具有適當備份的系統中移除所有工作負載。
  • 您不需要從系統完全停止或移除所有資源(VM、Web 應用程式等)。 不過,您可以在資源停用過程中停止或移除這些資源,以管理使用量和成本。
  • 一旦系統永久關閉,就不會再報告任何進一步的使用資訊。

已連線 (Microsoft Entra ID) 案例

請遵循已連線 (Microsoft Entra ID) 環境中的下列步驟:

  1. 停用多租戶功能,方法是移除次級目錄:取消註冊客體目錄

  2. 確認已移除任何其他來賓目錄:擷取身份健康報告

  3. 移除用於使用量計費的任何租戶註冊:移除租戶映射

  4. 拿掉 Azure Stack Hub 註冊,並防止使用量數據推送至 Azure 計費。

    1. 請遵循 註冊 Azure Stack Hub 中的步驟,匯入 RegisterWithAzure.psm1 模組。
    2. 使用下列腳本來移除註冊資源。
    # 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>'
    
  5. 移除 Azure Stack Hub 的 Microsoft Entra 應用程式註冊:

    1. 使用 Azure PowerShell連線到 Azure Stack 環境。

    2. 在與上一個步驟相同的PowerShell實例中,執行下列腳本以匯出所有應用程式註冊標識碼的清單。

      $context = Get-AzContext
      if (!$context.Subscription){
      @"
      # Connect To Azure Stack Admin Azure Resource Manager endpoint first https://learn.microsoft.com/azure-stack/operator/azure-stack-powershell-configure-admin#connect-with-azure-ad
      "@ | Write-Host -ForegroundColor:Red
      }
      
      "Getting access token for tenant {0}" -f $context.Subscription.TenantID | Write-Host -ForegroundColor Green
      
      $azureRmProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
      $profileClient = New-Object Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient($azureRmProfile)
      $newtoken = $profileClient.AcquireAccessToken($context.Subscription.TenantID)
      
      $armEndpoint = $context.Environment.ResourceManagerUrl
      $applicationRegistrationParams = @{
          Method  = [Microsoft.PowerShell.Commands.WebRequestMethod]::Get
          Headers = @{ Authorization = "Bearer " + $newtoken.AccessToken }
          Uri = "$($armEndpoint.ToString().TrimEnd('/'))/applicationRegistrations?api-version=2014-04-01-preview"
      }
      
      $applicationRegistrations = Invoke-RestMethod @applicationRegistrationParams | Select-Object -ExpandProperty value
      "[{0}] App Registrations were found for {1}" -f $applicationRegistrations.appId.Count, $context.Environment.Name | Write-Host -ForegroundColor Green
      $applicationRegistrations.appId | Write-Host
      
    3. 請與您的 Microsoft Entra 系統管理員合作,移除先前產生的清單中的應用程式註冊。

      注意

      請小心執行應用程式註冊清除。 在移除這些之後,Azure Stack Hub 系統除了特殊許可權端點(PEP)之外,將無法使用。 無法還原應用程式註冊,而且您的系統在未重新部署的情況下將無法運作。

已中斷連線的案例

針對已中斷連線的環境,請遵循 從 Azure Stack Hub 移除啟用資源 程式。

關閉 Azure Stack Hub

有兩個選項可關閉您的 Azure Stack Hub 系統。 這兩個命令都需要雲端系統管理員連線到 特殊許可權端點

  1. 關閉 Azure Stack Hub (可復原):從特殊許可權端點執行 Stop-AzureStack PowerShell Cmdlet。

  2. 關閉 Azure Stack Hub(無法復原、抹除數據):從 Privileged 端點執行 Start-AzsCryptoWipe Cmdlet。

    重要

    執行此命令之後,戳記將無法復原。

後續步驟