|
2 | 2 | author: dlepow
|
3 | 3 | ms.service: azure-api-management
|
4 | 4 | ms.topic: include
|
5 |
| -ms.date: 02/21/2025 |
| 5 | +ms.date: 03/11/2025 |
6 | 6 | ms.author: danlep
|
7 | 7 | ---
|
8 | 8 |
|
9 | 9 | ## Automatic migration
|
10 | 10 |
|
11 |
| -After the retirement date, we'll automatically migrate remaining `stv1` service instances to the `stv2` compute platform. All affected customers will be notified of the upcoming automatic migration a week in advance. Automatic migration might cause downtime for your upstream API consumers. You may still migrate your own instances before automatic migration takes place. |
| 11 | +After the retirement date, we'll automatically migrate remaining `stv1` service instances to the `stv2` compute platform. All affected customers will be notified of the upcoming automatic migration a week in advance. Automatic migration might cause downtime for your upstream API consumers. You can still migrate your own instances before automatic migration takes place. |
12 | 12 |
|
13 |
| -### Virtual network configuration may be removed during automatic migration |
| 13 | +### Virtual network configuration might be removed during automatic migration |
14 | 14 |
|
15 | 15 | Im most cases, automatic migration retains the virtual network settings of your API Management instance, if they're configured. Under certain [special conditions](../articles/api-management/migrate-stv1-to-stv2-vnet.md#special-conditions-and-scenarios), the virtual network configuration of your `stv1` service instance is removed during automatic migration and, as a security measure, access to your service endpoints is blocked. If the network settings were removed during the migration process, you'll see a message in the portal similar to: `We have blocked access to all endpoints for your service`.
|
16 | 16 |
|
17 | 17 | :::image type="content" source="media/api-management-automatic-migration/blocked-access.png" alt-text="Screenshot of blocked access to API Management in the portal.":::
|
18 | 18 |
|
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. |
20 | 20 |
|
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 | +### Restore access and virtual network configuration |
23 | 22 |
|
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 | +If access is blocked, you can restore access to your service endpoints and your virtual network configuration using the portal or the Azure CLI. |
26 | 24 |
|
27 | 25 | > [!TIP]
|
28 | 26 | > 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.
|
29 | 27 |
|
| 28 | +#### [Portal](#tab/portal) |
| 29 | + |
| 30 | +1. In the portal, on the **Overview** page of the instance, select **Unblock my service**. This action isn't reversible. |
| 31 | + |
| 32 | + > [!WARNING] |
| 33 | + > After you unblock access to your service endpoints, they're publicly accessible from the internet. To protect your environment, make sure to reestablish your virtual network as soon as possible after unblocking access. |
| 34 | +
|
| 35 | +1. Redeploy your API Management instance in your virtual network. |
| 36 | + |
| 37 | + 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. |
| 38 | + |
| 39 | + |
| 40 | +#### [Azure CLI](#tab/cli) |
| 41 | + |
| 42 | +Run the following Azure CLI commands to enable access to the API Management instance and restore configuration of the specified virtual network. |
| 43 | + |
| 44 | +> [!NOTE] |
| 45 | +> 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=...`. |
| 46 | +
|
| 47 | +```azurecli |
| 48 | +APIM_NAME={name of your API Management instance} |
| 49 | +RG_NAME={name of your resource group} |
| 50 | +SUBNET_NAME={name of the subnet where your API Management instance was originally deployed} |
| 51 | +VNET_NAME={name of the virtual network where your API Management instance was originally deployed} |
| 52 | +VNET_TYPE={external or internal} |
| 53 | +
|
| 54 | +# Get resource ID of subnet |
| 55 | +SUBNET_ID=$(az network vnet subnet show \ |
| 56 | + --resource-group $RG_NAME \ |
| 57 | + --name $SUBNET_NAME \ |
| 58 | + --vnet-name $VNET_NAME \ |
| 59 | + --query id --output tsv) |
| 60 | +
|
| 61 | +# Get resource ID of API Management instance |
| 62 | +APIM_RESOURCE_ID=$(az apim show \ |
| 63 | + --resource-group $RG_NAME --name $APIM_NAME \ |
| 64 | + --query id --output tsv) |
| 65 | +
|
| 66 | +# Enable access to service endpoints and restore virtual network configuration |
| 67 | +az rest --method PATCH --uri "$APIM_RESOURCE_ID?api-version=2024-05-01" --body '{ |
| 68 | + "properties": { |
| 69 | + "virtualNetworkType": "'$VNET_TYPE'", |
| 70 | + "virtualNetworkConfiguration": { |
| 71 | + "subnetResourceId": "'$SUBNET_ID'" |
| 72 | + }, |
| 73 | + "customProperties": { |
| 74 | + "Microsoft.WindowsAzure.ApiManagement.Service.Disabled": "False" |
| 75 | + } |
| 76 | + } |
| 77 | +}' |
| 78 | +``` |
| 79 | +--- |
| 80 | + |
30 | 81 |
|
31 | 82 |
|
32 | 83 |
|
0 commit comments