How to check if my function app is accessing resources in a vnet

John Fahey 0 Reputation points
2023-03-07T04:52:18.2466667+00:00

Hello, I am trying to create a web app which takes data from an IOT hub and moves the data onto a database which is located on a server secured with a virtual network.

To attempt to achieve this, I have created a function app which has public access enabled, and has network injection enabled which points to the virtual network containing the database server. Firstly, is this the correct approach? If it is, how can I test that the function I have written is connecting to the database?

Thanks for the help!

John

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,264 questions
Azure Database for PostgreSQL
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. msrini-MSFT 9,256 Reputation points Microsoft Employee
    2023-03-07T06:39:44.4466667+00:00

    Hi,

    Why do you need a Function app to pull data from Web app and push it to a VM in a VNET?

    You can directly enable VNET connectivity from Web App and push data from Web app to VM in the vNET directly.

    Regards,

    Karthik Srinivas

    0 comments No comments

  2. MughundhanRaveendran-MSFT 12,421 Reputation points
    2023-03-08T13:20:04.17+00:00

    @John Fahey

    I hope this is your scenario -> IOT hub is enabled with public access and the Database is present in Vnet

    For this use case, you can use IOT hub triggered azure function and write code to connect to the Database depending on the kind of database you are using. If it is SQL database, you can use the SQL bindings for Azure function ( This is still in preview). The function app can be integrated with Vnet, please make sure that the vnet is same as that of the database.

    To test the connectivity you can perform tcpping from the function app to the SQL endpoint like below

    1. In Azure potal of Function app-> select console
    2. run this command-> tcpping server endpoint url:443

    User's image

    0 comments No comments