In Debug sessions, a Custom Skill cannot connect to Azure Functions which is on a Virtual Network

You Matsuo(松尾 陽) 65 Reputation points
2024-11-07T07:54:52.21+00:00

I'm trying to connect to a custom skill which is an Azure Function on a Virtual Network in Debug Sessions. Although it works in an indexer, it gives me the following error om a debug session.

Enrichment.WebApiSkill.custom-embeding-skillCould not execute skill because the Web Api request failed.Web Api response status: 'Forbidden', Web Api response details: '<!DOCTYPE html> <html> <head> <title>Web App - Unavailable</title> <style type="text/css"> html { height: 100%; width: 100%; } #feature { width: 960px; margin: 95px auto 0 auto; overflow: auto; } #content { font-family: "Segoe UI"; font-weight: normal; font-size: 22px; color: #ffffff; float: left; width: 460px; margin-top: 68px; margin-left: 0px; vertical-align: middle; } #content h1 { font-family: "Segoe UI Light"; color: #ffffff; font-weight: normal; font-size: 60px; line-height: 48pt; width: 800px; } p a, p a:visited, p a:active, p a:hover { color: #ffffff; } #content a.button { background: #0DBCF2; border: 1px solid #FFFFFF; color: #FFFFFF; display: inline-block; font-family: Segoe UI; font-size: 24px; line-height: 46px; margin-top: 10px; padding: 0 15px 3px; text-decoration: none; } #content a.button img { float: right; padding: 10px 0 0 15px; } #content a.button:hover { background: #1C75BC; } </style> </head> <body bgcolor="#00abec"> <div id="feature"> <div id="content"> <h1 id="unavailable">Error 403 - Forbidden</h1> <p id="tryAgain">The web app you have attempted to reach has blocked your access.</p> </div> </div> </body> </html> '

My skillset is simple as below.

User's image

I set up a shared private link on AI Search to the Azure Function.

User's image

Network settings of the Azure Function. If I enable all public network access, debugging works well.

User's image

Both the AI Search and the Azure Functions on the same Virtual Network, but no luck, only in Debug sessions.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,929 questions
Azure AI Search
Azure AI Search
An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
1,350 questions
{count} votes

Accepted answer
  1. SnehaAgrawal-MSFT 22,706 Reputation points Moderator
    2024-11-08T04:18:57.97+00:00

    @You Matsuo(松尾 陽) Glad that you were able to resolve your issue and I appreciate your effort in sharing the solution.

    Your contribution will undoubtedly assist others facing similar challenges.

    As the [Microsoft Q&A community follows a policy where the question author cannot accept their own answer] {https://learn.microsoft.com/en-us/answers/support/accept-answer} ,

    I've reposted your solution below.  Feel free to consider "Accepting" the answer if you find it suitable.

    Resolution- Issue resolved when 'Allow access' from AI Search via setting a service tag AzureCognitiveSearch in the Azure Function's network setting.

    User's image

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. You Matsuo(松尾 陽) 65 Reputation points
    2024-11-08T01:43:46.2066667+00:00

    Ah finally I figured out. I had to allow access from AI Search via setting a service tag AzureCognitiveSearch in the Azure Function's network setting.

    User's image

    1 person found this answer helpful.
    0 comments No comments

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.