適用対象: ✔️ Front Door (クラシック)
Azure Front Door Standard および Premium レベルでは、最新のクラウド提供ネットワーク機能が Azure に提供されます。 強化されたセキュリティ機能とオールインワン サービスにより、アプリケーション コンテンツをセキュリティで保護し、Microsoft グローバル ネットワークを使用してエンド ユーザーの近くに置くことができます。 この記事では、Azure PowerShell を使用して Azure Front Door (クラシック) プロファイルを Standard または Premium いずれかのレベルのプロファイルに移す移行プロセスを説明します。
前提条件
-
Front Door のレベルの移行に関する記事を確認する。
- Front Door (クラシック) プロファイルを移行できることを確認する。
- Azure Front Door Standard および Premium では,すべてのカスタム ドメインが HTTPS を使用する必要があります。 独自の証明書がない場合は、Azure Front Door マネージド証明書を使用できます。 このための証明書は無料であり、その管理は自動的に行われます。
- セッション アフィニティは、Azure Front Door Standard または Premium プロファイルの配信元グループの設定で有効になります。 Azure Front Door (クラシック) では、セッション アフィニティはドメイン レベルで設定されています。 移行の一環として、セッション アフィニティは Front Door (クラシック) プロファイルの設定に基づいて設定されます。 クラシック プロファイルに同じバックエンド プール (配信元グループ) を共有する 2 つのドメインがある場合、移行の検証に合格するためには、その 2 つのドメインのセッション アフィニティが一致している必要があります。
- ローカルにインストールされた最新の Azure PowerShell モジュールまたは Azure Cloud Shell。 詳細については、Azure PowerShell のインストールおよび構成をご覧ください。
注
移行プロセスの前または実行中に DNS を変更する必要はありません。 ただし、移行が完了し、トラフィックが新しい Azure Front Door プロファイルを通過するようになった後で、DNS レコードを更新する必要があります。 詳しくは、「DNS レコードを更新する」を参照してください。
互換性を検証する
Azure PowerShell を開き、自身の Azure アカウントに接続します。 詳細については、「Azure PowerShell への接続」を参照してください。
Azure Front Door (クラシック) プロファイルをテストして、移行に対応しているかどうかを確認します。
Test-AzFrontDoorCdnProfileMigration コマンドを使用してプロファイルをテストできます。 リソース グループ名とリソース ID の値は各自の値に置き換えてください。 Front Door (クラシック) プロファイルのリソース ID は Get-AzFrontDoor を使用して取得します。
コマンド内の以下の値を置き換えます。
-
<subscriptionId>
: サブスクリプション ID。
-
<resourceGroupName>
: Front Door (クラシック) のリソース グループ名。
-
<frontdoorClassicName>
: Front Door (クラシック) プロファイルの名前。
Test-AzFrontDoorCdnProfileMigration -ResourceGroupName <resourceGroupName> -ClassicResourceReferenceId /subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/Microsoft.Network/frontdoors/<frontdoorClassicName>
検証している移行が実行可能である場合は、次の出力が表示されます。
CanMigrate DefaultSku
---------- ----------
True Standard_AzureFrontDoor or Premium_AzureFrontDoor
移行が実行可能でない場合は、次の出力が表示されます。
CanMigrate DefaultSku
---------- ----------
False
移行を準備する
注
- 現在、マネージド証明書 Azure Government Cloud の Azure Front Door Standard または Premium ではサポートされていません。 Azure Government Cloud で Azure Front Door Standard または Premium に BYOC を使用するか、この機能が使用可能になるまで待つ必要があります。
Start-AzFrontDoorCdnProfilePrepareMigration コマンドを実行して移行の準備をします。 リソース グループ名、リソース ID、プロファイル名の値を各自の値に置き換えます。
SkuName には、Standard_AzureFrontDoor または Premium_AzureFrontDoor を使用します。
SkuName は、Test-AzFrontDoorCdnProfileMigration コマンドからの出力に基づきます。
コマンド内の以下の値を置き換えます。
-
<subscriptionId>
: サブスクリプション ID。
-
<resourceGroupName>
: Front Door (クラシック) のリソース グループ名。
-
<frontdoorClassicName>
: Front Door (クラシック) プロファイルの名前。
Start-AzFrontDoorCdnProfilePrepareMigration -ResourceGroupName <resourceGroupName> -ClassicResourceReferenceId /subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/Microsoft.Network/frontdoors/<frontdoorClassicName> -ProfileName myAzureFrontDoor -SkuName Premium_AzureFrontDoor
出力は、次のようになります。
Starting the parameter validation process.
The parameters have been successfully validated.
Your new Front Door profile is being created. Please wait until the process has finished completely. This may take several minutes.
Your new Front Door profile with the configuration has been successfully created.
Get-AzFrontDoorWafPolicy コマンドを実行して、WAF ポリシーのリソース ID を取得します。 リソース グループ名と WAF ポリシー名を各自の値に置き換えます。
Get-AzFrontDoorWafPolicy -ResourceGroupName myAFDResourceGroup -Name myClassicFrontDoorWAF
出力は、次のようになります。
PolicyMode : Detection
PolicyEnabledState : Enabled
RedirectUrl :
CustomBlockResponseStatusCode : 403
CustomBlockResponseBody :
RequestBodyCheck : Disabled
CustomRules : {}
ManagedRules : {Microsoft.Azure.Commands.FrontDoor.Models.PSAzureManagedRule}
Etag :
ProvisioningState : Succeeded
Sku : Classic_AzureFrontDoor
Tags :
Id : /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myClassicFrontDoorWAF
Name : myFrontDoorWAF
Type :
New-AzFrontDoorCdnMigrationWebApplicationFirewallMappingObject コマンドを実行して、WAF ポリシー移行用のメモリ内オブジェクトを作成します。 直前のステップの WAF ID を MigratedFromId
に使用します。 既存の WAF ポリシーを使用する場合は、MigratedToId
の値を、移行先の Front Door レベルに合った WAF ポリシーのリソース ID に置き換えます。 WAF ポリシーの新しいコピーを作成する場合は、リソース ID で WAF ポリシーの名前を変更できます。
$wafMapping = New-AzFrontDoorCdnMigrationWebApplicationFirewallMappingObject -MigratedFromId /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myClassicFrontDoorWAF -MigratedToId /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myFrontDoorWAF
Start-AzFrontDoorCdnProfilePrepareMigration コマンドを実行して移行の準備をします。 リソース グループ名、リソース ID、プロファイル名の値を各自の値に置き換えます。
SkuName には、Standard_AzureFrontDoor または Premium_AzureFrontDoor を使用します。
SkuName は、Test-AzFrontDoorCdnProfileMigration コマンドからの出力に基づきます。
コマンド内の以下の値を置き換えます。
-
<subscriptionId>
: サブスクリプション ID。
-
<resourceGroupName>
: Front Door (クラシック) のリソース グループ名。
-
<frontdoorClassicName>
: Front Door (クラシック) プロファイルの名前。
Start-AzFrontDoorCdnProfilePrepareMigration -ResourceGroupName <resourceGroupName> -ClassicResourceReferenceId /subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/Microsoft.Network/frontdoors/<frontdoorClassicName> -ProfileName myAzureFrontDoor -SkuName Premium_AzureFrontDoor -MigrationWebApplicationFirewallMapping $wafMapping
出力は、次のようになります。
Starting the parameter validation process.
The parameters have been successfully validated.
Your new Front Door profile is being created. Please wait until the process has finished completely. This may take several minutes.
Your new Front Door profile with the configuration has been successfully created.
BYOC を含む Front Door プロファイルを移行する場合は、Front Door プロファイルでマネージド ID を有効にする必要があります。 Front Door プロファイルに、証明書が格納されているキー コンテナーへのアクセス許可を与える必要があります。
Start-AzFrontDoorCdnProfilePrepareMigration コマンドを実行して移行の準備をします。 リソース グループ名、リソース ID、プロファイル名の値を各自の値に置き換えます。
SkuName には、Standard_AzureFrontDoor または Premium_AzureFrontDoor を使用します。
SkuName は、Test-AzFrontDoorCdnProfileMigration コマンドからの出力に基づきます。
システム割り当て済み
IdentityType には、SystemAssigned を使用します。
Start-AzFrontDoorCdnProfilePrepareMigration -ResourceGroupName myAFDResourceGroup -ClassicResourceReferenceId /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/Frontdoors/myAzureFrontDoorClassic -ProfileName myAzureFrontDoor -SkuName Premium_AzureFrontDoor -IdentityType SystemAssigned
ユーザー割り当て済み
Get-AzUserAssignedIdentity コマンドを実行して、ユーザー割り当て ID のリソース ID を取得します。
$id = Get-AzUserAssignedIdentity -ResourceGroupName myResourceGroup -Name afduseridentity
$id.Id
出力は、次のようになります。
/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/afduseridentity
IdentityType には UserAssigned を使用し、IdentityUserAssignedIdentity には前のステップからのリソース ID を使用します。
コマンド内の以下の値を置き換えます。
-
<subscriptionId>
: サブスクリプション ID。
-
<resourceGroupName>
: Front Door (クラシック) のリソース グループ名。
-
<frontdoorClassicName>
: Front Door (クラシック) プロファイルの名前。
Start-AzFrontDoorCdnProfilePrepareMigration -ResourceGroupName <resourceGroupName> -ClassicResourceReferenceId /subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/Microsoft.Network/frontdoors/<frontdoorClassicName> -ProfileName myAzureFrontDoor -SkuName Premium_AzureFrontDoor -IdentityType UserAssigned -IdentityUserAssignedIdentity @{"/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/afduseridentity" = @{}}
出力は、次のようになります。
Starting the parameter validation process.
The parameters have been successfully validated.
Your new Front Door profile is being created. Please wait until the process has finished completely. This may take several minutes.
Your new Front Door profile with the configuration has been successfully created.
この例では、複数の WAF ポリシーを含む Front Door プロファイルを移行して、システム割り当て ID とユーザー割り当て ID の両方を有効にする方法を示します。
Get-AzFrontDoorWafPolicy コマンドを実行して、WAF ポリシーのリソース ID を取得します。 リソース グループ名と WAF ポリシー名を各自の値に置き換えます。
Get-AzFrontDoorWafPolicy -ResourceGroupName myAFDResourceGroup -Name myClassicFrontDoorWAF
出力は、次のようになります。
PolicyMode : Detection
PolicyEnabledState : Enabled
RedirectUrl :
CustomBlockResponseStatusCode : 403
CustomBlockResponseBody :
RequestBodyCheck : Disabled
CustomRules : {}
ManagedRules : {Microsoft.Azure.Commands.FrontDoor.Models.PSAzureManagedRule}
Etag :
ProvisioningState : Succeeded
Sku : Classic_AzureFrontDoor
Tags :
Id : /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myClassicFrontDoorWAF
Name : myFrontDoorWAF
Type :
New-AzFrontDoorCdnMigrationWebApplicationFirewallMappingObject コマンドを実行して、WAF ポリシー移行用のメモリ内オブジェクトを作成します。 直前のステップの WAF ID を MigratedFromId
に使用します。 既存の WAF ポリシーを使用する場合は、MigratedToId
の値を、移行先の Front Door レベルに合った WAF ポリシーのリソース ID に置き換えます。 WAF ポリシーの新しいコピーを作成する場合は、リソース ID で WAF ポリシーの名前を変更できます。
$wafMapping1 = New-AzFrontDoorCdnMigrationWebApplicationFirewallMappingObject -MigratedFromId /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myClassicFrontDoorWAF1 -MigratedToId /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myFrontDoorWAF1
$wafMapping2 = New-AzFrontDoorCdnMigrationWebApplicationFirewallMappingObject -MigratedFromId /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myClassicFrontDoorWAF2 -MigratedToId /subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.Network/frontdoorwebapplicationfirewallpolicies/myFrontDoorWAF2
両方のマネージド ID 型を変数に指定します。
$identityType = "SystemAssigned, UserAssigned"
Get-AzUserAssignedIdentity コマンドを実行して、ユーザー割り当て ID のリソース ID を取得します。
$id1 = Get-AzUserAssignedIdentity -ResourceGroupName myResourceGroup -Name afduseridentity1
$id1.Id
$id2 = Get-AzUserAssignedIdentity -ResourceGroupName myResourceGroup -Name afduseridentity2
$id2.Id
出力は、次のようになります。
/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/afduseridentity1
/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourcegroups/myAFDResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/afduseridentity2
ユーザー割り当て ID のリソース ID を変数に指定します。
$userInfo = @{
"subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/afduseridentity1" = @{}}
"subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/afduseridentity2" = @{}}
}
Start-AzFrontDoorCdnProfilePrepareMigration コマンドを実行して移行の準備をします。 リソース グループ名、リソース ID、プロファイル名の値を各自の値に置き換えます。
SkuName には、Standard_AzureFrontDoor または Premium_AzureFrontDoor を使用します。
SkuName は、Test-AzFrontDoorCdnProfileMigration コマンドからの出力に基づきます。
MigrationWebApplicationFirewallMapping パラメーターは、WAF ポリシー移行オブジェクトの配列を受け取ります。
IdentityType パラメーターは、ID 型のコンマ区切りリストを受け取ります。
IdentityUserAssignedIdentity パラメーターは、ユーザー割り当て ID のリソース ID を含むハッシュ テーブルを受け取ります。
コマンド内の以下の値を置き換えます。
-
<subscriptionId>
: サブスクリプション ID。
-
<resourceGroupName>
: Front Door (クラシック) のリソース グループ名。
-
<frontdoorClassicName>
: Front Door (クラシック) プロファイルの名前。
Start-AzFrontDoorCdnProfilePrepareMigration -ResourceGroupName <resourceGroupName> -ClassicResourceReferenceId /subscriptions/<subscriptionId>/resourcegroups/<resourceGroupName>/providers/Microsoft.Network/frontdoors/<frontdoorClassicName> -ProfileName myAzureFrontDoor -SkuName Premium_AzureFrontDoor -MigrationWebApplicationFirewallMapping @($wafMapping1, $wafMapping2) -IdentityType $identityType -IdentityUserAssignedIdentity $userInfo
出力は、次のようになります。
Starting the parameter validation process.
The parameters have been successfully validated.
Your new Front Door profile is being created. Please wait until the process has finished completely. This may take several minutes.
Your new Front Door profile with the configuration has been successfully created.
移行する
Enable-AzFrontDoorCdnProfileMigration コマンドを実行して、Front Door (クラシック) を移行します。
Enable-AzFrontDoorCdnProfileMigration -ProfileName myAzureFrontDoor -ResourceGroupName myAFDResourceGroup
出力は、次のようになります。
Start to migrate.
This process will disable your Front Door (classic) profile and move all your traffic and configurations to the new Front Door profile.
Migrate succeeded.
Stop-AzFrontDoorCdnProfileMigration コマンドを実行して、移行プロセスを中止します。
Stop-AzFrontDoorCdnProfileMigration -ProfileName myAzureFrontDoor -ResourceGroupName myAFDResourceGroup
出力は、次のようになります。
Start to abort the migration.
Your new Front Door Profile will be deleted and your existing profile will remain active. WAF policies will not be deleted.
Please wait until the process has finished completely. This may take several minutes.
Abort succeeded.
DNS レコードを更新する
古い Azure Front Door (クラシック) インスタンスでは、Azure Front Door Standard および Premium とは異なる完全修飾ドメイン名 (FQDN) が使用されます。 たとえば、Azure Front Door (クラシック) エンドポイントは contoso.azurefd.net
であり、Azure Front Door Standard または Premium エンドポイントは contoso-mdjf2jfgjf82mnzx.z01.azurefd.net
である場合があります。 Azure Front Door Standard および Premium エンドポイントの詳細については、「Azure Front Door のエンドポイント」を参照してください。
移行プロセスの前または実行中に DNS レコードを更新する必要はありません。 Azure Front Door ではユーザーが構成を変更しなくても、Azure Front Door (クラシック) エンドポイントで受け取ったトラフィックを Azure Front Door Standard または Premium プロファイルに自動的に送信します。
しかし、移行の完了後には、新しい Azure Front Door Standard または Premium エンドポイントにトラフィックが転送されるように DNS レコードを更新することを強くお勧めします。 DNS レコードを変更することは、プロファイルが今後も引き続き確実に機能することに役立ちます。 DNS レコードの変更によってダウンタイムが発生することはありません。 この更新の実施を事前に計画する必要はなく、都合の良い時期にスケジュールできます。
次のステップ