9.0 Step 6: Configure Networking

This example shows how to retrieve the current networking settings, and then modifying them. The GET method returns information for the network, test network, and replication network. It also provides information about the allowed NIC for the source.

Method: GET

https://10.10.10.143/MigrateApi/2019.8/transformations/72a53b12-31eb-4111-af3d-aa6400f1cb6c/networking

Response: Data returned from GET

{
    "networkConnections": [
        {
            "subnet": "default",
            "resourceGroup": "SB-W2012-R2-STD-VM-Resources",
            "includePublicIp": false,
            "isPrimary": true,
            "sourceConnectionName": "Ethernet",
            "includeInTarget": true,
            "tcpIpSettings": {
                "addressAllocationMethod": "dhcp",
                "ipAddressSettings": [],
                "defaultGateways": [],
                "dnsServers": [],
                "mtu": null,
                "type": "TcpIpSettings"
            },
            "virtualNetworkName": "1112a-WASATCH-RG-vnet",
            "type": "AzureNetworkConnection"
        }
    ],
    "testNetworkConnections": [
        {
            "subnet": "default",
            "resourceGroup": "SB-W2012-R2-STD-VM-Resources",
            "includePublicIp": false,
            "isPrimary": true,
            "sourceConnectionName": "Ethernet",
            "includeInTarget": true,
            "tcpIpSettings": {
                "addressAllocationMethod": "dhcp",
                "ipAddressSettings": [],
                "defaultGateways": [],
                "dnsServers": [],
                "mtu": null,
                "type": "TcpIpSettings"
            },
            "virtualNetworkName": "1112a-WASATCH-RG-vnet",
            "type": "AzureNetworkConnection"
        }
    ],
    "replicationNetwork": {
        "subnet": "default",
        "resourceGroup": "SB-W2012-R2-STD-VM-Resources",
        "includePublicIp": false,
        "isPrimary": true,
        "sourceConnectionName": "",
        "includeInTarget": true,
        "tcpIpSettings": {
            "addressAllocationMethod": "dhcp",
            "ipAddressSettings": [],
            "defaultGateways": [],
            "dnsServers": [],
            "mtu": null,
            "type": "TcpIpSettings"
        },
        "virtualNetworkName": "1112a-WASATCH-RG-vnet",
        "type": "AzureNetworkConnection"
    },
    "allowedSourceNetworkAdapters": [
        {
            "name": "Ethernet",
            "ipAddresses": [
                "10.10.11.12",
                "fe80::2c32:d2f3:7ba4:a0a4"
            ],
            "dhcpEnabled": true,
            "allowedForReplication": true,
            "type": "SourceNetworkAdapter"
        }
    ],
    "type": "NetworkingTransformation"
}

You use a PUT method to modify networking settings. The following example modifies the subnet and virtualNetworkName settings for the network, test network, and replication network. The subnet setting will change from "default" to "Subnet2". The virtualNetworkName will change from "1112a-WASATCH-RG-vnet" to "PlateSpinTest". The remaining settings are unchanged. If the PUT is successful, the call returns the new networking data, which should match the submitted data.

Method: PUT

https://10.10.10.143/MigrateApi/2019.8/transformations/72a53b12-31eb-4111-af3d-aa6400f1cb6c/networking

{
    "networkConnections": [
        {
            "subnet": "Subnet2",
            "resourceGroup": "SB-W2012-R2-STD-VM-Resources",
            "includePublicIp": false,
            "isPrimary": true,
            "sourceConnectionName": "Ethernet",
            "includeInTarget": true,
            "tcpIpSettings": {
                "addressAllocationMethod": "dhcp",
                "ipAddressSettings": [],
                "defaultGateways": [],
                "dnsServers": [],
                "mtu": null,
                "type": "TcpIpSettings"
            },
            "virtualNetworkName": "PlateSpinTest",
            "type": "AzureNetworkConnection"
        }
    ],
    "testNetworkConnections": [
        {
            "subnet": "Subnet2",
            "resourceGroup": "SB-W2012-R2-STD-VM-Resources",
            "includePublicIp": false,
            "isPrimary": true,
            "sourceConnectionName": "Ethernet",
            "includeInTarget": true,
            "tcpIpSettings": {
                "addressAllocationMethod": "dhcp",
                "ipAddressSettings": [],
                "defaultGateways": [],
                "dnsServers": [],
                "mtu": null,
                "type": "TcpIpSettings"
            },
            "virtualNetworkName": "PlateSpinTest",
            "type": "AzureNetworkConnection"
        }
    ],
    "replicationNetwork": {
        "subnet": "Subnet2",
        "resourceGroup": "SB-W2012-R2-STD-VM-Resources",
        "includePublicIp": false,
        "isPrimary": true,
        "sourceConnectionName": "",
        "includeInTarget": true,
        "tcpIpSettings": {
            "addressAllocationMethod": "dhcp",
            "ipAddressSettings": [],
            "defaultGateways": [],
            "dnsServers": [],
            "mtu": null,
            "type": "TcpIpSettings"
        },
        "virtualNetworkName": "PlateSpinTest",
        "type": "AzureNetworkConnection"
    },
    "allowedSourceNetworkAdapters": [
        {
            "name": "Ethernet",
            "ipAddresses": [
                "10.10.11.12",
                "fe80::2c32:d2f3:7ba4:a0a4"
            ],
            "dhcpEnabled": true,
            "allowedForReplication": true,
            "type": "SourceNetworkAdapter"
        }
    ],
    "type": "NetworkingTransformation"
}