Connect Visual Studio 2019 to Application Insights Government Cloud RRS feed

  • Question

  • I am trying to add Application Insights to an Azure Government hosted program.  However, when I add the connected service -> application insights -> Get Started button I receive an message stating that I have no subscription.  If I select a commercial Azure subscription, I am able to proceed.  Can someone tell me how to connect my Visual Studio 2019 to the Azure Government Cloud?
    Thursday, November 7, 2019 3:09 PM

All replies

  • Thanks Jones for reaching out. 

    Currently for Azure Government customers, the only way to enable Application Insights via the traditional Add Applications Insights Telemetry button in Visual Studio requires a small manual workaround. Customers experiencing the associated issue may see error messages like "There is no Azure subscription associated with this account or "The selected subscription does not support Application Insights even though the microsoft.insights resource provider has a status of registered for the subscription. To mitigate this issue, you must perform the following steps:

    1. Switch Visual Studio to target the Azure Government cloud.
    2. Create (or if already existing set) the User Environment variable for AzureGraphApiVersion as follows: (To create a User Environment variable go to Control Panel > System > Advanced system settings > Advanced > Environment Variables.) Variable name: AzureGraphApiVersion Variable value: 2014-04-01
    3. Make the appropriate Application Insights SDK endpoint modifications for either ASP.NET or ASP.NET Core depending on your project type.

    Additional Documentation Reference talking about the same.

    Hope this information helps, please revert back if you have any queries. 

    Friday, November 8, 2019 1:35 AM