Skip to content

Commit 973fa59

Browse files
Merge pull request #247229 from MJyot/main
Update related to Day 0 bug causing resource group deletion
2 parents cac03b7 + 0ce9681 commit 973fa59

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

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

Lines changed: 11 additions & 6 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 <V1 application gateway SubscriptionId>` 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 <V1 application gateway SubscriptionId>` 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,19 @@ 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.
8485

85-
1. Run `Get-Help AzureAppGWMigration.ps1` to examine the required parameters:
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+
```
90+
4. Run `Get-Help AzureAppGWMigration.ps1` to examine the required parameters:
8691

8792
```
8893
AzureAppGwMigration.ps1
@@ -163,7 +168,7 @@ To run the script:
163168
* **validateMigration: [switch]: Optional**. Use this parameter if you want the script to do some basic configuration comparison validations after the V2 gateway creation and the configuration copy. By default, no validation is done.
164169
* **enableAutoScale: [switch]: Optional**. Use this parameter if you want the script to enable autoscaling on the new V2 gateway after it's created. By default, autoscaling is disabled. You can always manually enable it later on the newly created V2 gateway.
165170
166-
1. Run the script using the appropriate parameters. It may take five to seven minutes to finish.
171+
5. Run the script using the appropriate parameters. It may take five to seven minutes to finish.
167172
168173
**Example**
169174

0 commit comments

Comments
 (0)