A Little Background
I build Power Apps for my company. We leverage Multiple DEV environments, UAT environments and production environments as part of our platform governance. What environments are used depends on what the app is and whom it is for. We are also leveraging solutions to perform promotion from DEV->UAT->Production. We have been doing that for about 9 months or so, but all manually. Ugh, what a PITA and so time consuming.
As part of our Power App development we are also leveraging Azure Insights, so we have the Instrumentation key stored in the App object. There lies our problem, the Instrumentation key value cannot use a variable or code to set it. It is basically hardcoded in the App object. This presents a problem for us as we use different Azure Insights instances for each environment.
We are now in the process of introducing Azure DevOps into our deployment process. Eliminating the manual process we do now to move code from one environment to another.
So you are all caught up on what we have been up to...
DevOps Approach
We are building Pipelines to perform builds and promotion of our solutions.
Step One: Build Pipelines
Each Build Pipeline uses a Task group to create a new Build for a solution. The Task group has the following steps:
- Export Solution as Managed
- Export Solution as Unmanaged
- Unpack Managed Solution
- Unpack Unmanaged Solution
- Publish Artifacts Managed Solution
- Publish Artifacts Managed Solution
- Check-in All Assets to Repository
So the goal here is to export a solution as both managed and unmanaged, unpack it, and store all the unpacked code in the source repository.
Our goal is to store the source of the exported ZIP files in source control, not the actual ZIP files. When we deploy a Solution to another environment we repack the solution from the repository and import that packed solution.
So that is step one... COMPLETED
Step Two-X: Work in Progress
What I would like to do from here is to pack the code back into solutions but first update the InstrumentationKey then import the solution into the appropriate environment. I am looking for some advice on the best way to accomplish this. We have instrumentation keys for DEV, UAT and Prod. So we would need to use the same source repository and update the key, pack a solution, then do it again for prod. (This would be so much easier if Microsoft allowed the use of an environment variable, or a variable period, to set the key.) But short of that miracle, can anyone provide any advice on how best to accomplish what we need?
Thank in advance.
Steven