title: Get Connection String in Azure Function v3
body: <p>I am very confused. I want to get a connection string in an Azure v3 function (.Net Core 3.1).</p>
  <p>My local settings looks like</p>
  <pre><code>{
      &quot;IsEncrypted&quot;: false,
      &quot;Values&quot;: {
          &quot;AzureWebJobsStorage&quot;: &quot;UseDevelopmentStorage=true&quot;,
          &quot;AzureWebJobsDashboard&quot;: &quot;UseDevelopmentStorage=true&quot;
      },
      &quot;ConnectionStrings&quot;: {
        &quot;DefaultConnection&quot;: &quot;bla bla&quot;
      }
  }
  </code></pre>
  <p>and in the function I do</p>
  <pre><code>string defaultConnection = Environment.GetEnvironmentVariable(&quot;ConnectionStrings:DefaultConnection&quot;);
  </code></pre>
  <p>This works fine locally but on Azure, defaultConnection is null. I defined the connection under the section Connection strings of the function's Application Settings.</p>
  <p><a href="https://i.stack.imgur.com/cAMdg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/cAMdg.png" alt="enter image description here" /></a></p>
  <p>Is my approach correct for Azure function v3?</p>