この記事では、Azure Stack Hub システムの使用を停止する方法について説明します。 システム ハードウェアを再利用する前に、次の手順に従って、テナントワークロードがセキュリティで保護され、機密情報が削除され、システムがAzureで登録解除されていることを確認します。
Prerequisites
開始する前に、次の前提条件が満たされていることを確認します。
- 適切なバックアップを使用して、システムからすべてのワークロードを削除します。
- すべてのリソース (VM、Web アプリなど) をシステムから完全に停止または削除する必要はありません。 ただし、これらのリソースを停止または削除して、使用停止プロセス中の使用量とコストを管理できます。
- システムが完全にシャットダウンされると、それ以上の使用状況情報は報告されません。
接続済み (Microsoft Entra ID) シナリオ
接続された (Entra ID) 環境で、次の手順に従います。
セカンダリ ディレクトリを削除してマルチテナントを無効にする: ゲスト ディレクトリの登録を解除します。
追加のゲスト ディレクトリが削除されたことを確認します。 ID 正常性レポートを取得します。
使用量課金のテナント登録を削除する: テナント マッピングを削除します。
Azure Stack Hub登録を削除し、使用状況データがAzure課金にプッシュされないようにします。
- Register Azure Stack Hub の手順に従って RegisterWithAzure.psm1 モジュールをインポートします。
- 登録リソースを削除するには、次のスクリプトを使用します。
# 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>'Azure Stack Hub Microsoft Entraアプリの登録を削除します。
前の手順と同じ 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-HostEntra 管理者と協力して、以前に生成された一覧のアプリ登録を削除してください。
Note
アプリの登録のクリーンアップに進むには注意が必要です。 特権エンドポイント (PEP) の外部では、これらのアプリの登録が削除された後、Azure Stack Hub システムが使用できなくなります。 アプリの登録を復元することはできません。また、再デプロイしないとシステムは機能しません。
オフライン シナリオ
切断された環境の場合は、「アクティブ化リソースをAzure Stack Hubから削除する」の手順に従います。
Azure Stack Hubをシャットダウンする
Azure Stack Hub システムは、2 つの方法でシャットダウンできます。 どちらのオプションでも、クラウド管理者は 特権エンドポイントに接続する必要があります。
Azure Stack Hubシャットダウン (回復可能): 特権エンドポイントから Stop-AzureStack PowerShell コマンドレットを実行します。
Azure Stack Hubシャットダウン (回復不可、データがワイプされます): 特権エンドポイントから Start-AzsCryptoWipe コマンドレットを実行します。
Important
このコマンドを実行すると、スタンプは回復できません。
次のステップ
- Azure Stack Hub診断ツールについて説明します。
- Stop-AzureStack。
- Start-AzsCryptoWipe。