Connecting to a Azure MySQL instance from Data Factory Linked Service

Navid Erfani-Ghadimi 0 Reputation points
2023-10-10T15:33:47.4133333+00:00

I have an Azure Mysql Instance in a Virtual Network created as part of the instance setup. I want to be able to copy data to MYSQL as a Copy Data sink. When I try to set up a connection to the MySQL instance using the AutoResolveIntegrationRuntime it resolves the Azure MySQL DB instance and the Database Names. But when I try to test the connection I get an error "11793 - Unable to connect to any of the specified MySQL hosts".

User's image

The Connectivity Menu for the MySql instance says that "Only resources within the virtual network or a peered network to your server will have access".

User's image

Is there a way that I can add the Data Factory to the Virtual Network or link it as a peered network?

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,545 questions
Azure Database for MySQL
Azure Database for MySQL
An Azure managed MySQL database service for app development and deployment.
864 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,985 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Aniruddha Deswandikar 5 Reputation points Microsoft Employee
    2024-02-12T19:28:30.4433333+00:00

    The connectivity issue was fixed after I added the ADF Managed Identity to the MySQL IAM. I think that is what was missing.

    1 person found this answer helpful.

  2. Oury Ba-MSFT 19,801 Reputation points Microsoft Employee
    2023-10-12T21:06:47.08+00:00

    @Navid Erfani-Ghadimi

    Let me assume here that you are using Azure MySQL Database.

    Could you please check if the data factory is in in the same VNET as the MYSQL VNET. If not, the error message is expected.

    You can add your Azure Data Factory to the same virtual network as your Azure MySQL instance or peer the virtual network that your Azure Data Factory is in with the virtual network that your Azure MySQL instance is in.

    Here are the steps to add your Azure Data Factory to the virtual network: see https://learn.microsoft.com/en-us/azure/data-factory/managed-virtual-network-private-endpoint.

    Another solution is: if ADF is not in the same Vnet then create a managed endpoint. It establishes a private connection between ADF and MySQL DB.

     https://learn.microsoft.com/en-us/azure/data-factory/managed-virtual-network-private-endpoint#managed-private-endpoints

    Please do let me if that works.

    Regards,

    Oury


  3. Aniruddha Deswandikar 5 Reputation points Microsoft Employee
    2024-02-06T08:34:01.05+00:00

    I am facing the exact same issue. I have the ADF and Azure MySQL DB on the same VNet but different subnets. I get the Error 11793 while testing the connection. I have multi-auth enabled. I tried both the Entra ID and the MySQL Admin user. I then tried moving the ADF to the same subnet. But no luck. I am able to connect to the MySQL through MySQL Workbench. So the Server is active and accessible. The error too is not descriptive at all. No details. Just one line saying "Unable to connect to any of the specified MYSQL Hosts".


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.