1

I have a service fabric application that hosts api’s with app insights enabled. The api services are .Net framework 4.8 webapi projects and they are native fabric stateless and stateful services. I don’t use the app insights service fabric specific packages, but do have the standard app insights for webapi packages. I have always been in Azure commercial and logs have worked just fine there.

Now that we are in azure gov, the only way to point a .Net Framework app to the gov app insights endpoints is by modifying the ApplicationInsights.config file.

So I’ve modified the file as per msdn, verified it is deployed with the fabric deploy package and its there next to the rest of the dlls on the vms. Yet my services still won’t log to azure gov app insight instances. Nothing is coming through. We set the instrumentation key programmatically, not in applicationinsights.config, could that be an issue? I noticed some of the msdn examples showed instrumentationkey being included in the config file, but would think that is optional.

Had anyone had experience pointing .net 4.8 fabric services to gov app insights?

Josh
  • 1,648
  • 8
  • 27
  • 58
  • Do you have a firewall that may be blocking `23.97.4.113`? (link)[https://learn.microsoft.com/en-us/azure/azure-government/compare-azure-government-global-azure#management-and-governance] – LoekD Aug 23 '21 at 09:17
  • No there is no firewall, and if I use an commercial instrumentation key is happily started logging to commercial ai again even with the gov endpoint applicationinsights.config. So it seems my issue is that it is entirely ignoring the gov endpoint overrides and potentially the entire config file. – Josh Aug 23 '21 at 12:17

2 Answers2

1

When using a government cloud, you need to use a connection string instead of an instrumentation key.

Important

Sovereign clouds, such as Azure Government, require the use of the Application Insights connection string (APPLICATIONINSIGHTS_CONNECTION_STRING) instead of the instrumentation key. To learn more, see the APPLICATIONINSIGHTS_CONNECTION_STRING reference.

More info here and here.

LoekD
  • 11,402
  • 17
  • 27
  • Correct. Application Insights uses different ingestion endpoints for Azure Government. Though it is possible to override and manually configure the right endpoints, it is way more straightforward to switch to Connection String. That string includes all needed endpoints for Application Insights to work. – ZakiMa Sep 17 '21 at 22:59
0

This ended up being an issue with my gov configuration file. The MSDN document wasn't very clear on where the new config sections go. It made it look like they are all nested under the top level node of the config file. Turns out the TelementyChannel override has to go inside the default TelemenySinks node. I contacted microsoft on github about clarifying this in their docs.

Link to the unclear documentation

https://learn.microsoft.com/en-us/azure/azure-monitor/app/custom-endpoints?tabs=net

Link to github issue to get it fixed

https://github.com/MicrosoftDocs/azure-docs/issues/80066

Josh
  • 1,648
  • 8
  • 27
  • 58