Configure network connectivity to SQL Server sources on Azure
Stay organized with collections
Save and categorize content based on your preferences.
This page describes how to configure network connectivity to SQL Server
sources on Microsoft Azure for heterogeneous SQL Server to
Cloud SQL for PostgreSQL migrations with Database Migration Service. Database Migration Service
supports Microsoft Azure SQL Managed Instance and Microsoft Azure SQL Database
as source databases.
There are three different methods you can use to configure the necessary
network connectivity for migrations from SQL Server sources on Azure:
To use the public IP allowlist connectivity method, follow these steps:
Configure your source Microsoft Azure SQL Managed Instance to allow
public network access from
Database Migration Service public IP addresses for the region where you
create the migration job.
In the Define connection details section,
use your instance's fully qualified server name for the source database IP.
For more information about how to view the connection details of
your Microsoft Azure SQL Managed Instance instance, see
Get server connection information in the Microsoft
documentation.
In the Define connectivity method section, select
IP allowlist.
Configure connectivity over a forward-SSH tunnel
To connect to your source database with a Secure Shell (SSH) tunnel,
follow these steps:
Create a virtual machine in Microsoft Azure to serve as a dedicated
forward-SSH tunnel server. Make sure you configure it in the same
Azure Virtual Network where your source SQL Server has
a private IP assigned.
Create a separate, dedicated user account for Database Migration Service to
connect as:
adduserTUNNEL_ACCOUNT_USERNAME
Restrict shell access for the Database Migration Service account to
enhance security:
usermod-s/usr/sbin/nologinTUNNEL_ACCOUNT_USERNAME
Decide what authentication method you want Database Migration Service to use
when connecting to the tunnel.
You can use a simple password, or generate SSH keys in the
PEM format that you can later upload to Database Migration Service
when you create the source connection profile.
If you want to use a password, you don't need to configure anything
additional. Remember what password you created for the
TUNNEL_ACCOUNT_USERNAME account.
If you want to use key-based authentication, you need to generate
a private-public key pair. For example, you can use the
ssh-keygen utility:
Generate the key pair:
ssh-keygen-mPEM-fYOUR_KEY_NAME
Copy the public key (YOUR_KEY_NAME.pub)
to the ~/.ssh/ directory on your tunnel server.
Save the private key. You need to upload it later to Database Migration Service
when you create the source connection profile.
Edit the /etc/ssh/sshd_config file to configure the forward-SSH
tunnel to match your organization's requirements.
We recommend using the following settings:
# Only allow the Database Migration Service user to connect.
AllowUsersTUNNEL_ACCOUNT_USERNAME# Send keep-alive packets every 60 seconds to ensure that# the tunnel doesn't close during the migrationServerAliveInterval=60# Optional: Force key-based authentication
PasswordAuthenticationno
# Enables Database Migration Service to connect from a different host
PermitTunnelyes
GatewayPortsyes
Run the ssh command to start the tunnel.
Before using any of the command data below, make the following replacements:
TUNNEL_SERVER_SSH_PORT with the port number
where your server is listening for SSH connections.
SOURCE_DATABASE_PRIVATE_IP with the private
IP address of your source database. The SSH server needs to be able to
reach that IP.
SOURCE_DATABASE_PORT with the port number
where your source database is listening for connections. The default port
number for TCP connections on SQL Server is 1433.
USERNAME with the name of the user account that
will be running the tunnel. This is a separate account from
TUNNEL_ACCOUNT_USERNAME.
TUNNEL_SERVER_PUBLIC_IP with the public IP
of your SSH tunnel server.
To use private connectivity with Microsoft Azure SQL Managed Instance sources,
you need to have a Cloud VPN or Cloud Interconnect configured in the same
VPC network where you intend to create the private connectivity configuration
for Database Migration Service. If you can't create the private connectivity configuration
in the VPC network where you have your Cloud VPN or Cloud Interconnect,
then you also need a reverse proxy Virtual Machine (VM) on Compute Engine to
establish the connection.
If you can't use Cloud VPN or Cloud Interconnect, we recommend
that you use the
forward-SSH tunnel or the
IP allowlist
connectivity methods instead.
To use private connectivity with VPC peering and Cloud VPN,
follow these steps:
Set up direct connectivity with Cloud VPN to your
Microsoft Azure SQL Managed Instance source.
Optional: If you can't create the private connectivity configuration
in the same VPC network where you have the Cloud VPN,
create
a reverse proxy Virtual Machine (VM) on Compute Engine
to forward the connections between VPCs.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eDatabase Migration Service facilitates heterogeneous migrations from SQL Server on Microsoft Azure to Cloud SQL for PostgreSQL, supporting Azure SQL Managed Instance and Azure SQL Database.\u003c/p\u003e\n"],["\u003cp\u003eThree network connectivity methods are available for these migrations: public IP allowlist, forward-SSH tunnel, and private IP connectivity with Virtual Private Cloud peering.\u003c/p\u003e\n"],["\u003cp\u003eThe public IP allowlist method requires configuring the source Azure SQL Managed Instance to accept connections from Database Migration Service's public IP addresses.\u003c/p\u003e\n"],["\u003cp\u003eUtilizing a forward-SSH tunnel involves setting up a dedicated virtual machine in Azure as an SSH server and creating a dedicated account for Database Migration Service to use for secure access.\u003c/p\u003e\n"],["\u003cp\u003ePrivate connectivity with VPC peering necessitates a Cloud VPN or Cloud Interconnect setup in the same VPC network or a reverse proxy VM to bridge the connection, with the recommendation to use the forward-SSH tunnel or IP allowlist if these methods are unavailable.\u003c/p\u003e\n"]]],[],null,["# Configure network connectivity to SQL Server sources on Azure\n\nThis page describes how to configure network connectivity to SQL Server\nsources on Microsoft Azure for heterogeneous SQL Server to\nCloud SQL for PostgreSQL migrations with Database Migration Service. Database Migration Service\nsupports Microsoft Azure SQL Managed Instance and Microsoft Azure SQL Database\nas source databases.\n\nThere are three different methods you can use to configure the necessary\nnetwork connectivity for migrations from SQL Server sources on Azure:\n\n- [Public IP allowlist](#ip-allowlist#)\n- [Forward-SSH tunnel](#forward-ssh)\n- Requires Cloud VPN or Cloud Interconnect: [Private IP connectivity with Virtual Private Cloud peering](#private-vpc-peering)\n\nTo learn more about source database network connectivity, see\n[Source networking methods overview](/database-migration/docs/sqlserver-to-csql-pgsql/networking-methods-source).\n\nConfigure IP allowlist connectivity\n-----------------------------------\n\nTo use the public IP allowlist connectivity method, follow these steps:\n\n1. Configure your source Microsoft Azure SQL Managed Instance to allow\n public network access from\n [Database Migration Service public IP addresses](/database-migration/docs/sqlserver-to-csql-pgsql/ip-allowlists-and-regions) for the region where you\n create the migration job.\n\n For more information, see\n [Change public network access](https://learn.microsoft.com/en-us/azure/azure-sql/database/connectivity-settings#change-public-network-access) in the Microsoft documentation.\n2. At a later stage, when you [create the source connection profile](/database-migration/docs/sqlserver-to-csql-pgsql/create-source-connection-profile), do the following:\n 1. In the **Define connection details** section,\n use your instance's fully qualified server name for the source database IP.\n\n For more information about how to view the connection details of\n your Microsoft Azure SQL Managed Instance instance, see\n [Get server connection information](https://learn.microsoft.com/en-us/azure/azure-sql/database/connect-query-content-reference-guide) in the Microsoft\n documentation.\n 2. In the **Define connectivity method** section, select **IP allowlist**.\n\nConfigure connectivity over a forward-SSH tunnel\n------------------------------------------------\n\nTo connect to your source database with a Secure Shell (SSH) tunnel,\nfollow these steps:\n\n1. Create a virtual machine in Microsoft Azure to serve as a dedicated\n forward-SSH tunnel server. Make sure you configure it in the same\n Azure Virtual Network where your source SQL Server has\n a private IP assigned.\n\n For more information, see\n [Quickstart: Create a Linux virtual machine in the Azure portal](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal)\n in the Microsoft documentation. You don't need to create the\n web server mentioned in the quickstart.\n2. [Connect to your EC2 instance](https://learn.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal#connect-to-virtual-machine) and set up the SSH tunnel. Follow these steps:\n 1. Create a separate, dedicated user account for Database Migration Service to connect as: \n\n ```bash\n adduser TUNNEL_ACCOUNT_USERNAME\n ```\n 2. Restrict shell access for the Database Migration Service account to enhance security: \n\n ```bash\n usermod -s /usr/sbin/nologin TUNNEL_ACCOUNT_USERNAME\n ```\n 3. Decide what authentication method you want Database Migration Service to use\n when connecting to the tunnel.\n\n You can use a simple password, or generate SSH keys in the\n `PEM` format that you can later upload to Database Migration Service\n when you create the source connection profile.\n - If you want to use a password, you don't need to configure anything additional. Remember what password you created for the \u003cvar translate=\"no\"\u003eTUNNEL_ACCOUNT_USERNAME\u003c/var\u003e account.\n - If you want to use key-based authentication, you need to generate a private-public key pair. For example, you can use the `ssh-keygen` utility:\n 1. Generate the key pair: \n\n ```bash\n ssh-keygen -m PEM -f YOUR_KEY_NAME\n \n ```\n 2. Copy the public key (\u003cvar translate=\"no\"\u003eYOUR_KEY_NAME\u003c/var\u003e`.pub`) to the `~/.ssh/` directory on your tunnel server.\n 3. Save the private key. You need to upload it later to Database Migration Service when you create the source connection profile.\n 4. Edit the `/etc/ssh/sshd_config` file to configure the forward-SSH tunnel to match your organization's requirements. We recommend using the following settings: \n\n ```bash\n # Only allow the Database Migration Service user to connect.\n AllowUsers TUNNEL_ACCOUNT_USERNAME\n\n # Send keep-alive packets every 60 seconds to ensure that\n # the tunnel doesn't close during the migration\n ServerAliveInterval=60\n\n # Optional: Force key-based authentication\n PasswordAuthentication no\n\n # Enables Database Migration Service to connect from a different host\n PermitTunnel yes\n GatewayPorts yes\n ```\n 5. Run the `ssh` command to start the tunnel.\n\n Before using any of the command data below, make the following replacements:\n - \u003cvar class=\"edit\" scope=\"TUNNEL_SERVER_SSH_PORT\" translate=\"no\"\u003eTUNNEL_SERVER_SSH_PORT\u003c/var\u003e with the port number where your server is listening for SSH connections.\n - \u003cvar class=\"edit\" scope=\"SOURCE_DATABASE_PRIVATE_IP\" translate=\"no\"\u003eSOURCE_DATABASE_PRIVATE_IP\u003c/var\u003e with the private IP address of your source database. The SSH server needs to be able to reach that IP.\n - \u003cvar class=\"edit\" scope=\"SOURCE_DATABASE_PORT\" translate=\"no\"\u003eSOURCE_DATABASE_PORT\u003c/var\u003e with the port number where your source database is listening for connections. The default port number for TCP connections on SQL Server is `1433`.\n - \u003cvar class=\"edit\" scope=\"USERNAME\" translate=\"no\"\u003eUSERNAME\u003c/var\u003e with the name of the user account that will be running the tunnel. This is a separate account from \u003cvar translate=\"no\"\u003eTUNNEL_ACCOUNT_USERNAME\u003c/var\u003e.\n - \u003cvar class=\"edit\" scope=\"TUNNEL_SERVER_PUBLIC_IP\" translate=\"no\"\u003eTUNNEL_SERVER_PUBLIC_IP\u003c/var\u003e with the public IP of your SSH tunnel server.\n\n ```bash\n ssh -N -L \\\n TUNNEL_SERVER_SSH_PORT:SOURCE_DATABASE_PRIVATE_IP:SOURCE_DATABASE_PORT \\\n USERNAME@TUNNEL_SERVER_PUBLIC_IP\n ```\n3. At a later stage, when you [create the source connection profile](/database-migration/docs/sqlserver-to-csql-pgsql/create-source-connection-profile), do the following:\n 1. In the **Define connection details** section, enter the private IP of your Microsoft Azure SQL Managed Instance source.\n 2. In the **Define connectivity method** section, select **Forward-SSH tunnel**.\n 3. Provide the public IP address or hostname of your SSH server.\n 4. Provide the port that you designated for the SSH connections on the tunnel server.\n 5. Enter the username for the user you created for Database Migration Service to connect as (that is, the value of \u003cvar translate=\"no\"\u003eTUNNEL_ACCOUNT_USERNAME\u003c/var\u003e).\n 6. From the **Authentication method** drop-down menu, select the authentication method you want to use with \u003cvar translate=\"no\"\u003eTUNNEL_ACCOUNT_USERNAME\u003c/var\u003e:\n - If you want to use the user password, select **Password** and enter \u003cvar translate=\"no\"\u003eTUNNEL_ACCOUNT_USERNAME\u003c/var\u003e password in the form.\n - If you configured your SSH server to use key-based authentication, select **Private/Public key pair** and upload the **private key** [you generated in with the `ssh-keygen` command](#generate-ssh-keys-step).\n\nConfigure private connectivity with VPC peering\n-----------------------------------------------\n\nTo use private connectivity with Microsoft Azure SQL Managed Instance sources,\nyou need to have a Cloud VPN or Cloud Interconnect configured in the same\nVPC network where you intend to create the private connectivity configuration\nfor Database Migration Service. If you can't create the private connectivity configuration\nin the VPC network where you have your Cloud VPN or Cloud Interconnect,\nthen you also need a reverse proxy Virtual Machine (VM) on Compute Engine to\nestablish the connection.\n\nIf you can't use Cloud VPN or Cloud Interconnect, we recommend\nthat you use the\n[forward-SSH tunnel](#forward-ssh-tunnel) or the\n[IP allowlist](#ip-allowlist)\nconnectivity methods instead.\n\nTo use private connectivity with VPC peering and Cloud VPN,\nfollow these steps:\n\n1. Set up direct connectivity with Cloud VPN to your\n Microsoft Azure SQL Managed Instance source.\n\n For more information, see\n [Create HA VPN connections between Google Cloud and Azure](/network-connectivity/docs/vpn/tutorials/create-ha-vpn-connections-google-cloud-azure)\n in the Cloud VPN documentation.\n2. Optional: If you can't create the private connectivity configuration in the same VPC network where you have the Cloud VPN, create [a reverse proxy Virtual Machine (VM) on Compute Engine](/database-migration/docs/sqlserver-to-csql-pgsql/configure-src-connection-reverse-proxy) to forward the connections between VPCs.\n3. In Database Migration Service, [create a private connectivity configuration](/database-migration/docs/sqlserver-to-csql-pgsql/create-private-connectivity-configuration) to peer with the VPC network where you have your Cloud VPN.\n4. At a later stage, when you [create the source connection profile](/database-migration/docs/sqlserver-to-csql-pgsql/create-source-connection-profile), do the following:\n 1. In the **Define connection details** section, enter the private IP of your Microsoft Azure SQL Managed Instance source.\n 2. In the **Define connectivity method** section, select **Private connectivity (VPC peering)**.\n 3. From the drop-down menu, select the private connectivity configuration you created in the previous step."]]