How to fix "Failed to configure C# code file(s)" error while adding SQL server dependency for Azure function in Visual studio 2022

Desai, Pradipkumar 20 Reputation points
2024-01-02T05:24:15.58+00:00

I have created brand new Azure function project in Visual studio 2022 and trying to add SQL server dependency as a Connected service. However I get this error for both Azure and local SQL database. Visual studio is running in Admin mode

Steps -

  1. Right click on Connected services and add SQL server
  2. Select SQL server database or Azure SQL Database and click new
  3. Give connection name and connection string and select option "Local user secret file"
  4. Click finish

User's image

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,931 questions
{count} votes

Accepted answer
  1. JananiRamesh-MSFT 29,276 Reputation points
    2024-01-10T03:48:39.5133333+00:00

    @Desai, Pradipkumar Thanks for your patience! The code update is currently broken for isolated functions and our product group team is working on it.

    Work-around would be to uncheck the code option while setting up the SQL connected service.

    User's image

    User's image

    do try and let me know incase of further queries, I would be happy to assist you.

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

    1 person found this answer helpful.
    0 comments No comments

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.