Azure の登録の検証

Azure Stack Hub のデプロイを開始する前に、Azure Stack Hub 適合性チェッカー ツール (AzsReadinessChecker) を使用して、Azure Stack Hub で Azure サブスクリプションをすぐに使用できることを検証します。 適合性チェッカーは以下を検証します。

  • 使用する Azure サブスクリプションの種類がサポート対象であること。 サブスクリプションは、クラウド ソリューション プロバイダー (CSP) またはマイクロソフトエンタープライズ契約 (EA) である必要があります。
  • ご自身のサブスクリプションの登録に使用するアカウントが Azure にサインインでき、サブスクリプション所有者であること。

Azure Stack Hub 登録の詳細については、「Azure を使用した Azure Stack Hub の登録」を参照してください。

適合性チェッカー ツールを取得する

最新バージョンの AzsReadinessChecker を PowerShell ギャラリーからダウンロードします。

インストールと構成

前提条件

以下の前提条件が必要です。

Az PowerShell モジュール

Az PowerShell モジュールをインストールしておく必要があります。 手順については、「PowerShell Az プレビュー モジュールをインストールする」を参照してください。

Microsoft Entra 環境

  • Azure Stack Hub で使用する Azure サブスクリプションの所有者であるアカウントのユーザー名とパスワードを識別します。
  • 使用する Azure サブスクリプションのサブスクリプション ID を識別します。

Azure の登録を検証する手順

  1. 管理者特権の PowerShell プロンプトを開き、次のコマンドを実行して、AzsReadinessChecker をインストールします。

    Install-Module -Name Az.BootStrapper -Force -AllowPrerelease
    Install-AzProfile -Profile 2020-09-01-hybrid -Force
    Install-Module -Name Microsoft.AzureStack.ReadinessChecker
    
  2. PowerShell プロンプトから次のコマンドを実行して、$subscriptionID を、使用する Azure サブスクリプションとして設定します。 xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx をお使いのサブスクリプション ID に置き換えます。

    $subscriptionID = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    
  3. PowerShell プロンプトから、次のコマンドを実行します。

    Connect-AzAccount -subscription $subscriptionID
    
  4. PowerShell プロンプトから次のコマンドを実行して、お使いのサブスクリプションの検証を開始します。 Microsoft Entra管理者とMicrosoft Entraテナント名を指定します。

    Invoke-AzsRegistrationValidation  -RegistrationSubscriptionID $subscriptionID
    
  5. ツールの実行後、出力を確認します。 サインインと登録の両方の要件ついて、状態が適切であることを確認します。 検証が成功した場合の出力は、次の例のように表示されます。

    Invoke-AzsRegistrationValidation v1.2100.1448.484 started.
    Checking Registration Requirements: OK
    
    Log location (contains PII): C:\Users\[*redacted*]\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessChecker.log
    Report location (contains PII): C:\Users\[*redacted*]\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessCheckerReport.json
    Invoke-AzsRegistrationValidation Completed
    

レポートとログ ファイル

検証を実行するたびに、結果のログが AzsReadinessChecker.log と AzsReadinessCheckerReport.json に出力されます。 これらのファイルの場所は、PowerShell に検証結果と共に表示されます。

これらのファイルは、Azure Stack Hub をデプロイする前、または検証に関する問題を調査する前に、検証の状態を共有するときに役立ちます。 両方のファイルに、以降の各検証チェックの結果が保持されます。 デプロイ チームはこのレポートを使用して ID 構成を確認できます。 デプロイ チームやサポート チームは、検証の問題を調査する際に、このログ ファイルを役立たせることができます。

既定では、両方のファイルが C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessCheckerReport.json に書き込まれます

  • 別のレポートの場所を指定するには、実行コマンド ラインの末尾に -OutputPath <path> パラメーターを使用します。
  • ツールの以前の実行に関する情報を AzsReadinessCheckerReport.json からクリアするには、実行コマンド ラインの末尾に -CleanReport パラメーターを使用します。

詳細については、「Azure Stack Hub 検証レポート」を参照してください。

検証エラー

検証チェックに失敗した場合は、エラーの詳細が PowerShell ウィンドウに表示されます。 また、ツールによって、AzsReadinessChecker.log ファイルにログ情報が記録されます。

次の例は、一般的な検証エラーの詳細を示します。

ユーザーがサブスクリプションの所有者でなければならない

Invoke-AzsRegistrationValidation v1.1809.1005.1 started.
Checking Registration Requirements: Fail
Error Details for registration account admin@contoso.onmicrosoft.com:
The user admin@contoso.onmicrosoft.com is role(s) Reader for subscription 3f961d1c-d1fb-40c3-99ba-44524b56df2d. User must be an owner of the subscription to be used for registration.
Additional help URL https://aka.ms/AzsRemediateRegistration

Log location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessChecker.log
Report location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessCheckerReport.json
Invoke-AzsRegistrationValidation Completed

原因 - アカウントが Azure サブスクリプションの管理者ではありません。

解決策 - Azure サブスクリプション管理者であるアカウントを使用します。これは、Azure Stack Hub デプロイから使用の請求対象となります。

期限切れまたは一時パスワード

Invoke-AzsRegistrationValidation v1.1809.1005.1 started.
Checking Registration Requirements: Fail
Error Details for registration account admin@contoso.onmicrosoft.com:
Checking Registration failed with: Retrieving TenantId for subscription [subscription ID] using account admin@contoso.onmicrosoft.com failed with AADSTS50055: Force Change Password.
Trace ID: [Trace ID]
Correlation ID: [Correlation ID]
Timestamp: 2018-10-22 11:16:56Z: The remote server returned an error: (401) Unauthorized.

Log location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessChecker.log
Report location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessCheckerReport.json
Invoke-AzsRegistrationValidation Completed

原因 - パスワードの有効期限が切れているか一時パスワードであるため、アカウントでサインインできません。

解決策 - PowerShell で次のコマンドを実行し、プロンプトに従ってパスワードをリセットします。

Login-AzureRMAccount

別の方法として、Azure portal にアカウント所有者としてサインインします。この場合、ユーザーはパスワードの変更を強制されます。

ユーザーの種類が不明

Invoke-AzsRegistrationValidation v1.1809.1005.1 started.
Checking Registration Requirements: Fail
Error Details for registration account admin@contoso.onmicrosoft.com:
Checking Registration failed with: Retrieving TenantId for subscription <subscription ID> using <account> failed with unknown_user_type: Unknown User Type

Log location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessChecker.log
Report location (contains PII): C:\Users\username\AppData\Local\Temp\AzsReadinessChecker\AzsReadinessCheckerReport.json
Invoke-AzsRegistrationValidation Completed

原因 - アカウントは、指定したMicrosoft Entra環境にサインインできません。 この例では、AzureChinaCloud が AzureEnvironment として指定されています。

解決策 - 指定した Azure 環境に対してアカウントが有効であることを確認します。 PowerShell で次のコマンドを実行して、特定の環境に対してアカウントが有効であることを確認します。

Login-AzureRmAccount -EnvironmentName AzureChinaCloud

次の手順