Skip to main content
Community site session details

Community site session details

Session Id : /ru1fLmjAWNjp73wNbUpu7
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Environment variables for Canvas PowerApps Instrumentation Key

Like (3) ShareShare
ReportReport
Posted on 11 Jun 2021 05:37:13 by 28

Hello experts,

 

We have built a Canvas PowerApps where we are trying to use the Azure Application Insights key for the Instrumentation Key of the Canvas app.   The requirement is to have a different Insights key for different environments.  We tried to use environment variables to hold the instrumentation key for different environments but it seems like there is no support for environment variables on Instrumentation Key currently.

 

instrumentationkey.png

 

Is there any way where we can use a different key for different environments without manually updating the Canvas app after deploying to a different environment?  Please share any input around this so that manual intervention can be avoided during deployments.

 

Regards,

Palani K.B.

  • jm125245 Profile Picture
    on 20 Sep 2022 at 04:13:31
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    released feature request: Ability to add function on Instrumentation Key in ... - Power Platform Community (microsoft.com)

  • stingray Profile Picture
    194 on 26 Aug 2022 at 13:31:28
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    You don't need a premium licence to use Environment Variables if you are using SharePoint as a data source. 

  • stingray Profile Picture
    194 on 26 Aug 2022 at 13:31:14
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    You don't need a premium licence to use Environment Variables if you are using SharePoint as a data source. 

  • Phil_Cole Profile Picture
    133 on 09 Feb 2022 at 21:48:37
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    Instrumentation keys as a means to connect to Application Insights is not possible for new regions, see https://docs.microsoft.com/en-us/azure/azure-monitor/app/create-new-resource#copy-the-instrumentation-key

     

    Therefore I hope/suspect there will be some updates in this area.

  • AlexVin Profile Picture
    2 on 09 Feb 2022 at 13:06:42
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    @Palani  Did you find some solution for this?

  • MJKirts Profile Picture
    32 on 11 Nov 2021 at 21:30:43
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    @cchannon wrote:

    Have you added both Environment Variable Definitions and Environment Variable Values as tables from the data source?

    cchannon_3-1623758480920.png

     

     



    I tried this but it seems you can't do a Lookup in an App Properties object?  The application just crashes right on startup.  See screenshot for what I tried.  Any suggestions?  Am I just doing it wrong?  I just added this to the Instrumentation Key property:  LookUp('Environment Variable Values', 'Environment Variable Definition'.'Display Name' = "AppInsightsKey").Value

     

    MJKirts_0-1636666150451.png

     

  • Palani Profile Picture
    28 on 15 Jun 2021 at 14:36:13
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    Hi cchannon, I am not using CDS data source in the app.  My end users do not have license to support CDS. SharePoint is the data source of the app.  I am looking for a way to use environment variables directly without referencing CDS tables in my app, something similar to the latest datasource environment variables.

  • cchannon Profile Picture
    4,702 Moderator on 15 Jun 2021 at 12:01:50
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    Have you added both Environment Variable Definitions and Environment Variable Values as tables from the data source?

    cchannon_3-1623758480920.png

     

     

  • Palani Profile Picture
    28 on 15 Jun 2021 at 09:56:42
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    @cchannon Thanks for your response.  I agree that environment variables can hold string.  However, on the Instrumentation Key of the Canvas powerapps, I don't see an option to select an Environment Variable.  Do you have any idea on how to select an environment variable under the App Object as shown in the screenshot of my original post?

  • cchannon Profile Picture
    4,702 Moderator on 14 Jun 2021 at 12:53:57
    Re: Environment variables for Canvas PowerApps Instrumentation Key

    Environment Variables can hold a string. You don't need a special datatype for "instrumentation key".

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete