Azure Stack Hub システムの使用停止

この記事では、Azure Stack Hub システムの使用を適切に停止する方法について説明します。 システム ハードウェアを再利用する前に、次の手順に従って、テナント ワークロードがセキュリティで保護され、機密情報が削除され、システムが Azure で登録解除されていることを確認します。

前提条件

作業を開始する前に、次の前提条件を満たしていることを確認してください。

  • 適切なバックアップを使用して、すべてのワークロードがシステムから削除されていることを確認します。
  • システムからすべてのリソース (VM、Web アプリなど) を完全に停止または削除する必要はありません。 ただし、これらのリソースを停止または削除して、使用停止プロセス中の使用量とコストを管理できます。
  • システムが完全にシャットダウンされると、それ以上の使用状況情報は報告されません。

接続済み (Microsoft Entra ID) のシナリオ

接続された (Microsoft Entra ID) 環境で、次の手順に従います。

  1. セカンダリ ディレクトリを削除してマルチテナントを無効にする: ゲスト ディレクトリの登録を解除します

  2. 追加のゲスト ディレクトリが削除されたことを確認する: ID 正常性レポートを取得します。

  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 インスタンスで、次のスクリプトを実行して、すべてのアプリ登録 ID の一覧をエクスポートします。

      $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管理者と協力して、前に生成した一覧のアプリ登録を削除します。

      注意

      慎重にアプリ登録のクリーンアップに進みます。 特権エンドポイント (PEP) の外部では、Azure Stack Hub システムは削除されると使用できなくなります。 アプリの登録を復元することはできません。また、再デプロイしないとシステムは機能しません。

切断されたシナリオ

切断された環境の場合は、「 Azure Stack Hub からアクティブ化リソースを削除する 」の手順に従います。

Azure Stack Hub をシャットダウンする

Azure Stack Hub システムをシャットダウンするには、2 つのオプションがあります。 どちらのコマンドも、クラウド管理者が 特権エンドポイントに接続する必要があります。

  1. Azure Stack Hub をシャットダウンする (回復可能): 特権エンドポイントから Stop-AzureStack PowerShell コマンドレットを実行します。

  2. Azure Stack Hub をシャットダウンする (回復できない、データがワイプされる): 特権エンドポイントから Start-AzsCryptoWipe コマンドレットを実行します。

    重要

    このコマンドを実行すると、スタンプは回復できません。

次の手順