Here is my scenario:
- I have a c# blob trigger azure function (alwaysON set to true).
- I am setting the appsettings of the function app using New-AzureRmResource ps cmdlet.
- I am deploying the azure function by calling PUT Rest call on "https://$functionAppName.scm.azurewebsites.net/api/zip/site/wwwroot" to upload a zip file (which contains run.csx, function.json and bin/*.dll files).
- I use CloudConfigurationManager.GetSetting(settingKey) to get the appsettings in the *.dll files. I have a IsNullOrWhiteSpace check on these appsettings to throw a ConfigurationErrorsException.
Problem: After deploying, always the first trigger to the azure function fails. It fails with the ConfigurationErrorsException exception which i am throwing if a appsetting is IsNullOrWhiteSpace. After about a minute after the first failed trigger, all the subsequent triggers start to be successful.
Is it that it takes time for appsettings to get loaded ? Have any of you faced such issue before ? What is the workaround/solution for this ?