0

Get the DB strings from app.config with C# in Azure function.

In the below way I am accessing the strings:

var Conn = ConfigurationManager
                   .ConnectionStrings["ConnString"].ConnectionString

Looking for the good method to get control of database with conn strings.

1
  • Why not put it in the Function App configuration settings? Commented Dec 28, 2021 at 19:11

1 Answer 1

0

Using Configuration Manager is recommended when using Asp.Net Core Configuration System in an azure function.

You can access it via the GetConnectionString from the ConfigurationBuilder

var connectionString = config.GetConnectionString("SqlConnectionString");

Follow this link to add the configuration in your project - https://blog.jongallant.com/2018/01/azure-function-config/

Sign up to request clarification or add additional context in comments.

1 Comment

hey, thanks.. this is helpful.. Also I've gone through another SO which is related to this question. Adding it here so that it can help someone. stackoverflow.com/questions/37215069/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.