0

I am developing a web application using asp.net core RC2. I am hosting this application on Azure WebApp. I am using application insights in the application. Now I would like that the Instrumentation key is read from the webapp App Settings, so that my dev-ops can change it without redeploying the application(or I can add this to the azure web app without having to edit config files during automated deployment).

The only dynamic way I have seen is using

builder.AddApplicationInsightsSettings(instrumentationKey: iKey);

the problem with this is that the configuration is still not loaded so how can I read the value from web app to populate iKey.

yonisha
  • 2,956
  • 2
  • 25
  • 32
Ovais
  • 276
  • 1
  • 16

1 Answers1

0

You can set instrumentation key through config. See example here.
It will require application restart for new settings to be applied.

Alex Bulankou
  • 2,396
  • 19
  • 21
  • that is the question, I do not want the setting to be in the config, I want to read it from AzureWebApp settings. Like I have a connection string in my configuration which I can read locally and when my app is deployed on Azure I can read the connection string from Azure WebApp connection strings with exactly the same code. – Ovais Jun 18 '16 at 04:40
  • Is this what you are looking for? http://stackoverflow.com/questions/34732620/asp-net-vnext-app-settings-on-azure – Alex Bulankou Jun 18 '16 at 11:17