Skip to content

Commit 1ed7964

Browse files
author
gitName
committed
[APIM] Automatic migration w/ VNet
1 parent 3728bb9 commit 1ed7964

File tree

3 files changed

+58
-8
lines changed

3 files changed

+58
-8
lines changed

articles/api-management/migrate-stv1-to-stv2-vnet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: dlepow
66
ms.service: azure-api-management
77
ms.custom:
88
ms.topic: how-to
9-
ms.date: 02/19/2025
9+
ms.date: 03/10/2025
1010
ms.author: danlep
1111
---
1212

includes/api-management-automatic-migration.md

Lines changed: 57 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,66 @@ Im most cases, automatic migration retains the virtual network settings of your
1616

1717
:::image type="content" source="media/api-management-automatic-migration/blocked-access.png" alt-text="Screenshot of blocked access to API Management in the portal.":::
1818

19-
While access is blocked, access to the API gateway, developer portal, direct management API, and Git repository is disabled. To restore access to your service endpoints:
19+
While access is blocked, access to the API gateway, developer portal, direct management API, and Git repository is disabled.
2020

21-
1. Redeploy your API Management instance in your virtual network. For steps, see the guidance for deploying API Management in an [external](../articles/api-management/api-management-using-with-vnet.md) or [internal](../articles/api-management/api-management-using-with-internal-vnet.md) virtual network. We strongly recommend deploying the instance in a **new subnet** of the virtual network with settings compatible with the API Management `stv2` compute platform.
22-
1. After the virtual network is reestablished, unblock access to your service endpoints. In the portal, on the **Overview** page of the instance, select **Unblock my service**. This action is not reversible.
21+
To restore access to your service endpoints:
2322

24-
> [!WARNING]
25-
> If you unblock access to your service endpoints before reconfiguring the virtual network, your service endpoints will be publicly accessible from the internet. To protect your environment, make sure to reestablish your virtual network as soon as possible.
23+
1. Make sure you understand the following steps to re-establish your virtual network and are prepared to do so before proceeding.
24+
> [!TIP]
25+
> If you need a reminder of the names of the virtual network and subnet where your API Management instance was originally deployed, you can find information in the portal. In the left menu of your instance, select **Diagnose and solve problems** > **Availability and performance** > **VNet Verifier**. In **Time range**, select a period before the instance was migrated.
2626
27-
> [!TIP]
28-
> If you need a reminder of the names of the virtual network and subnet where your API Management instance was originally deployed, you can find information in the portal. In the left menu of your instance, select **Diagnose and solve problems** > **Availability and performance** > **VNet Verifier**. In **Time range**, select a period before the instance was migrated.
27+
1. Unblock access to your service endpoints. You can unblock access using the portal or the Azure CLI.
28+
29+
#### [Portal](#tab/portal)
30+
31+
In the portal, on the **Overview** page of the instance, select **Unblock my service**. This action is not reversible.
32+
> [!WARNING]
33+
> After you unblock access to your service endpoints, your service endpoints are publicly accessible from the internet. To protect your environment, make sure to reestablish your virtual network as soon as possible.
34+
35+
#### [Azure CLI](#tab/cli)
36+
37+
Run the following Azure CLI commands to update the API Management instance, setting variables where indicated.
38+
39+
> [!NOTE]
40+
> The following script is written for the bash shell. To run the script in PowerShell, prefix each variable name with the `$` character when setting the variables. Example: `$APIM_NAME=...`.
41+
42+
```azurecli
43+
APIM_NAME={name of your API Management instance}
44+
RG_NAME={name of your resource group}
45+
SUBNET_NAME={name of the subnet where your API Management instance was originally deployed}
46+
VNET_NAME={name of the virtual network where your API Management instance was originally deployed}
47+
VNET_TYPE={external or internal}
48+
49+
# Get resource ID of subnet
50+
SUBNET_ID=$(az network vnet subnet show \
51+
--resource-group $RG_NAME \
52+
--name $SUBNET_NAME \
53+
--vnet-name $VNET_NAME \
54+
--query id --output tsv)
55+
56+
# Get resource ID of API Management instance
57+
APIM_RESOURCE_ID=$(az apim show \
58+
--resource-group $RG_NAME --name $APIM_NAME \
59+
--query id --output tsv)
60+
61+
# Unblock access to service endpoints
62+
az rest --method PATCH --uri "$APIM_RESOURCE_ID?api-version=2024-05-01" --body '{
63+
"properties": {
64+
"virtualNetworkType": "'$VNET_TYPE'",
65+
"virtualNetworkConfiguration": {
66+
"subnetResourceId": "'$SUBNET_ID'"
67+
},
68+
"customProperties": {
69+
"Microsoft.WindowsAzure.ApiManagement.Service.Disabled": "False"
70+
}
71+
}
72+
}'
73+
```
74+
---
75+
76+
1. Redeploy your API Management instance in your virtual network.
77+
78+
For steps, see the guidance for deploying API Management in an [external](../articles/api-management/api-management-using-with-vnet.md) or [internal](../articles/api-management/api-management-using-with-internal-vnet.md) virtual network. We strongly recommend deploying the instance in a **new subnet** of the virtual network with settings compatible with the API Management `stv2` compute platform.
2979
3080
3181
-49.5 KB
Loading

0 commit comments

Comments
 (0)