Azure Function App interact with SQL virtual machines

Chen, Carson-WQ 61 Reputation points
2022-08-04T06:46:29.06+00:00

Dear sir,

I am finding a guideline/solution that how to connect to SQL virtual machines to query data in Azure Function App with Java language.

I find out a guideline about Use Azure Functions to connect to an Azure SQL Database:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-scenario-database-table-cleanup
but cannot find out doc about Use Azure Functions to connect to a SQL virtual machines.

Thank you for your help in advance.

SQL Server on Azure Virtual Machines
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,029 questions
0 comments No comments
{count} votes

Accepted answer
  1. AnuragSingh-MSFT 21,381 Reputation points
    2022-08-08T05:40:32.37+00:00

    Hi @Chen, Carson-WQ ,

    Thank you for posting this question on Microsoft Q&A.

    I understand that you want to connect to MSSql Server on an Azure VM from Java Azure Function App. I assume that you are trying to connect to the "SQL DB" so that you can query the data stored in SQL Server.

    For the scenario mentioned above, the basic concepts are the same in both cases (for Azure SQL DB as PAAS and for Azure SQL DB hosted on Azure VM as IAAS) :
    1. Get the ServerName, DB instance name and the port. For Azure SQL on Azure VM, please follow the link here: Connect to SQL Server to connect to the DB from your local machine to get these values and to ensure that you are able to connect. Also, ensure that respective ports are open on NSG/Firewall for connectivity.
    2. Once you are able to connect to the SQL DB from Sql Server Management Studio, as mentioned in point 1 above, you can use these values to create Connection URL and use it in your Java Azure Function.

    Please let me know if you have any questions.

    ---
    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.


0 additional answers

Sort by: Most helpful

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.