0

I'm using this link https://learn.microsoft.com/en-us/azure/azure-app-configuration/quickstart-azure-functions-csharp to connect my Azure Function to App Configuration to get settings. I am using the following code in my Startup.cs file:

public override void ConfigureAppConfiguration(IFunctionsConfigurationBuilder builder)
{
    string cs = Environment.GetEnvironmentVariable("ConnectionString");
    builder.ConfigurationBuilder.AddAzureAppConfiguration(cs);
}

It loads all the settings from App Configuration, and some of the settings are links to KeyVault secrets so it has to contact KeyVault as well. When I test locally, it takes a while to start up. Once it does, I can trigger the functions just fine (they are all HTTP triggers).

This function is going to be triggered sporadically, so does it cold start the whole function app every time? Is it going to call out to App Config and KeyVault every time it does the start up, if I haven't triggered the app in a while? Or does the ConfigureAppConfiguration method only run when you publish and it saves the configuration?

vkapadia
  • 290
  • 1
  • 6
  • 17

1 Answers1

1

This depends on your Azure Functions plan and how frequently your Functions app receives traffic. If your Functions app is idle for an extended time, it's more likely to be recycled on a consumption plan than on a dedicated plan. Every time your Functions app is recycled, it will reload data from Azure App Configuration and Key Vault upon restart.

Zhenlan Wang
  • 1,213
  • 8
  • 10