Skip to content

Commit b5cbbcc

Browse files
authored
Update migrate-v1-v2.md
Update based on Day 0 bug in the script where possible resource group deletion can happen
1 parent cac03b7 commit b5cbbcc

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

articles/application-gateway/migrate-v1-v2.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ This article primarily helps with the configuration migration. Client traffic mi
3737
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
3838

3939
> [!IMPORTANT]
40-
> Use a new PowerShell session each time to run the migration script. This applies when the migration fails or if you are using the script to migrate another V1 gateway. This is required because the initialized variables clean up the existing resource group before executing the migration script again.
41-
40+
>Run the Set-AzContext -Subscription '<AppGwV1SubscriptionId>' cmdlet every time before running the migration script. This is necessary to set the active Azure context to the correct subscription, because the migration script might clean up the existing resource group if it doesn't exist in current subscription context.
4241
## Configuration migration
4342

4443
An Azure PowerShell script is provided in this document. It performs the following operations to help you with the configuration:
@@ -53,7 +52,7 @@ You can download the migration script from the [PowerShell Gallery](https://www
5352
## Using the script
5453

5554
> [!NOTE]
56-
> Use a new PowerShell session each time to run the migration script. This applies when the migration fails or if you are using the script to migrate another V1 gateway. This is required because the initialized variables clean up the existing resource group before executing the migration script again.
55+
> Run the Set-AzContext -Subscription '<AppGwV1SubscriptionId>' cmdlet every time before running the migration script. This is necessary to set the active Azure context to the correct subscription, because the migration script might clean up the existing resource group if it doesn't exist in current subscription context.
5756
5857
There are two options for you depending on your local PowerShell environment setup and preferences:
5958

@@ -76,13 +75,20 @@ This command also installs the required Az modules.
7675

7776
If you have some Azure Az modules installed and can't uninstall them (or don't want to uninstall them), you can manually download the script using the **Manual Download** tab in the script download link. The script is downloaded as a raw nupkg file. To install the script from this nupkg file, see [Manual Package Download](/powershell/gallery/how-to/working-with-packages/manual-download).
7877

78+
#### How to run the script
79+
7980
To run the script:
8081

8182
1. Use `Connect-AzAccount` to connect to Azure.
8283

83-
1. Use `Import-Module Az` to import the Az modules.
84+
2. Use `Import-Module Az` to import the Az modules.
85+
86+
3. Run the Set-AzContext cmdlet ,to set the active Azure context to the correct subscription.This is an important step because the migration script might clean up the existing resource group if it doesn't exist in current subscription context.
87+
```
88+
Set-AzContext -Subscription '<V1 application gateway SubscriptionId>'
89+
```
8490

85-
1. Run `Get-Help AzureAppGWMigration.ps1` to examine the required parameters:
91+
5. Run `Get-Help AzureAppGWMigration.ps1` to examine the required parameters:
8692

8793
```
8894
AzureAppGwMigration.ps1

0 commit comments

Comments
 (0)