cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Palani
Frequent Visitor

Environment variables for Canvas PowerApps Instrumentation Key

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.

7 REPLIES 7
cchannon
Super User
Super User

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

Palani
Frequent Visitor

@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?

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

cchannon_3-1623758480920.png

 

 

Palani
Frequent Visitor

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.

MJKirts
Frequent Visitor


@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

 

alex-vinokikj
Regular Visitor

@Palani  Did you find some solution for this?

filcole
Advocate I
Advocate I

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-instrumentatio...

 

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

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Users online (2,948)