Azure data factory calling restapi hosted on app service

Pankaj Joshi 371 Reputation points
2025-02-08T05:15:33.36+00:00

I am calling restapi POST method hosted on app service from azure data factory(web activity) using VNet integration runtime, I am using authentication type as NONE. but it is giving error as Error "403 Forbidden 'the web app you have attempted to reach has block your access". However linked service connection is successful for restapi url. App service hosting Rest api is integrated with vnet (private end point enabled and disabled public network) and all required nsg are there. I also tried to add managed private end point from adf to app service but it does not have any option for app service. However I am able to call same restapi successfully from postman. Please advise what could be the issue, is it possible to call restapi hosted on app service from adf?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,271 questions
{count} votes

Accepted answer
  1. Chandra Boorla 8,795 Reputation points Microsoft Vendor
    2025-02-18T15:41:36.7566667+00:00

    @Pankaj Joshi

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer.

    Issue:

    Azure data factory calling restapi hosted on app service

    Solution:

    "It's not possible to achieve this with Managed VNet runtime. Another option is to use SHIR.

    We are able to call the REST API successfully with SHIR."

    If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

    Hope this helps. Do let us know if you have any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


1 additional answer

Sort by: Most helpful
  1. Vinodh247 28,211 Reputation points MVP
    2025-02-10T01:32:10.44+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    Yes, it is possible to call a REST API hosted on an App Service from ADF, but in your case, the issue arises because the App Service is integrated with a private endpoint, and public access is disabled. This results in a "403 Forbidden" error when ADF attempts to call the REST API because of network restrictions.

    1. Use Managed VNet in ADF Integration Runtime: Ensure that your ADF is using a managed VNet-enabled integration runtime.
    2. Configure VNet Peering: Peer the ADF managed VNet with the VNet where the App Service private endpoint is hosted.
    3. Private DNS Setup: Add a private DNS entry for the App Service ( myapp.privatelink.azurewebsites.net) in the DNS linked to the ADF managed VNet.
    4. Validate NSG Rules: Add NSG rules to allow traffic from ADF's managed VNet to the App Service's private endpoint subnet.
    5. Test Web Activity: Once the above configurations are complete, retry the Web activity in ADF.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.


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.