cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Solutions and environment variable issues

Hi,

 

We have a canvas app that uses SharePoint as the backend that has a dev, staging and production version across three environments. We have a single SharePoint site that each environment saves to and have been using a column to filter out data between each environments app/flows.

 

As part of an upgrade to our app we have created three separate SharePoint sites so each environment will connect to its own. All data sources in the app and all SharePoint connections in our flow point to environment variables. The intention being that when we make a change and push it through our environment's we only have to amend each environments, environment variables and everything is good to go.

 

In the future we plan to add several additional production versions of the app with their own SharePoint sites to cater to different teams.

 

Unfortunately we have been running into several issues, while I have most things worked out, I wouldn't mind some feedback on whether this is the correct approach and am just posting this for other users. We do not want to end up in a situation where each change we make to the app in dev requires extensive modifications per environment to get up and running.

 

Our setup

Environment Variables

One master variable to store that environments related SharePoint site. A variable per SharePoint list that uses the master variable for the site and points to the appropriate list under that site

 

Canvas app

Each data source is uses that master variable, then points to the related list environment variable.

 

Flows

Each SharePoint action uses the master variable, then the appropriate list environment variable, no SharePoint actions are directly pointed to SharePoint.

 

What we expected

When exporting the solution from dev as a managed solution, we import it into staging or prod and that it prompts or allows us to update the environment variables. Once all environment variables point to the site related to that environment. The app and flows work without issue.

 

What's happening

Environment variables

When importing we were not prompted, attempted removing the current value of each environment variable and re-importing with no luck. We could not amend the environment variables within the solution as it was managed. 

Fix -

  • Going to the default solution and amending them there - worked after lots of trial and error, ended up having to delete the solution from staging and re-importing it then modifying the environment variables, but that may be due to all the messing around I was doing. Hopefully modifying the default solution in the future just works.


Canvas app

After amending the environment variables then playing the canvas app only some data sources were pointing to the staging SharePoint site, with others pointing to the dev one, despite them using an environment variable that was pointing to staging.

 

To further test, back in dev I removed all data sources, re-added them via the site environment variable and re-exported then app and imported into staging with the same result.

 

Fix - Once in staging remove all data sources from the app and re-add them via the master site environment variable.

 

Flow

One of our PowerApps triggered flows was erroring, the 1st action that connects to SharePoint using the site environment variable and list environment variable errored, in the error log it was pointing to the dev site and not staging which the environment variable has been set to.

Fix - Started randomly working after about an hour...

 

14 REPLIES 14
hemrhk
Responsive Resident
Responsive Resident

@BenAu 

In Canvas App While connecting the datasources it should be loaded via Environment Variables otherwise it will be still pointing to the existing datasource.

Before exporting remove the values in the environment variable then only it will prompt to enter the datasources while importing.

 

Checkout this post to setup the solution,

https://365stack.in/index.php/2022/01/03/how-to-get-started-with-power-platform-solutions-canvas-app... 

 

------------------------------------------------------------------------------------------------- 

If it solved your problem give a kudo and accept it as a solution. 

Follow and Subscribe 365 Stack for more updates. 

Data sources within the canvas app are pointing to environment variables. After exporting/importing even though every data source pointed to an environment variable that was pointing to our staging data, some were still picking up dev data.

 

When i removed all data sources in the staging app and re-added, I added them using the exact same environment variables as dev and it worked. I guess I will have to monitor to see if future changes still cause have this issue.

 

Also tried clearing the values before exporting, it did not trigger a prompt to enter data source when importing.

 

The feature seems buggy to me.

 

Anonymous
Not applicable

Seconding BenAu--I'm having exactly the same issue with Canvas apps+SharePoint+SharePoint data source environment variables. When I migrate apps using SharePoint data sources I have to edit the app, manually remove all the environment variable references, then re-add them. And since this also adds an unmanaged layer to the testing/production managed solutions, I have to first remove that for every deploy past the first. Would love some guidance here!

We were unable to solve this, and have settled in with editing the apps, removing sources and re-adding. Then removing the unmanaged layer as you have been for each update.


Its annoying as some SharePoint data sources appear to properly connect to the lists the environment variables point to while others do not until being removed. So its like half working 😞

 

On top of the fact there appears to be no way to make PowerApps prompt to fill the environment variables in when importing so we have to do a workaround. 

Arkay71
Frequent Visitor

We had exactly the same problem but did manage to solve it (we think) like this:

 

1. In your DEV environment, remove the current value of the SharePoint Site and List connections so the values are both blank. I did this in the Solution itself.

2. Now open the PowerApp in DEV and remove, then re-add the datasource using the now empty environment variable - It should add OK but you'll get lots of red 'x' on the screen as the connections are empty.  Save and publish the app.

3. In your DEV solution, publish customizations and export the solution (we used Managed as we're going to PRO)

4. Import the solution into your PRO, or UAT, environment and provide the PRO values for your SharePoint Site and List.

 

You should now have your published PRO solution pointing to your PRO SP datasource without having to add an unmanaged layer...  I'm continuing to test but this seems to be working OK.  Feedback welcome (and Microsoft - PLEASE make this easier!!!)

Django
Impactful Individual
Impactful Individual

Another latest update (also see Solved: Updating Environment Variables in Managed Solution - Power Platform Community (microsoft.com...😞 you ALSO need to remove the Default Value from the Environment Variables to get the prompt during the Solution Import. In my multiple tests of a FIRST solution import, this gave me the modern wizard prompt to update the variables right after the step to update the Connection References with Connections.

I've been looking at this for the past few days and I've noticed that changing the value of the SharePoint environment variable in the recipient environment's Default solution doesn't work immediately, but does 'kick in' after around 60 to 70 minutes. In the testing I've done this was the case on every occasion and the apps and flows then worked as expected

 

I tried with just a current value ,just a default value and both current and default values and all eventually worked as they should. The delay isn't ideal, but waiting an hour or so when transitioning to a new environment is do-able

 

More testing tomorrow 

I have exactly the same issues. And yes, I remove the values from the variables before export. Sometimes I get prompted, sometimes I don't. I also noticed that removing and re-adding the variable from/to the app works. But seriously: That can't be the way!

In addition we face the issue that once we upgrade a solution the referring environment variables in the target environment are suddenly empty and must be set before removing and re-adding them to the app. This feature is rubbish.

And if I understand correctly, after such an operation, I have to go back to the solution on the DEV and from the soloution to update anew each Sharepoint storage variable, edit the application, remove the connections and add them anew in the reference to the environment variables? 😡

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!   This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions in the Forums to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersNumber of SolutionsSuper UsersNumber of Solutions @anandm08  23 @WarrenBelz  31 @DBO_DV  10 @Amik  19 AmínAA 6 @mmbr1606  12 @rzuber  4 @happyume  7 @Giraldoj  3@ANB 6 (tie)   @SpongYe  6 (tie)     Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Community MembersSolutionsSuper UsersSolutions @anandm08  10@WarrenBelz 25 @DBO_DV  6@mmbr1606 14 @AmínAA 4 @Amik  12 @royg  3 @ANB  10 @AllanDeCastro  2 @SunilPashikanti  5 @Michaelfp  2 @FLMike  5 @eduardo_izzo  2   Meekou 2   @rzuber  2   @Velegandla  2     @PowerPlatform-P  2   @Micaiah  2     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 3:Community MembersSolutionsSuper UsersSolutionsPower Apps anandm0861WarrenBelz86DBO_DV25Amik66Michaelfp13mmbr160647Giraldoj13FLMike31AmínAA13SpongYe27     Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Week 4:Community MembersSolutionsSuper UsersSolutionsPower Apps DBO-DV21WarranBelz26Giraldoj7mmbr160618Muzammmil_0695067Amik14samfawzi_acml6FLMike12tzuber6ANB8   SunilPashikanti8

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (782)