web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :

Moving From The Default Environment - Making Your App Solution Aware

wyattdave Profile Picture wyattdave 441 Moderator
If your environment isn't set to default new apps to being solution aware you will find that your app will require legacy export and miss out on key features like environment variables. This blog will show you the steps you need to move your app into a solution and switch data sources to environment variables (in this case SharePoint but same for SAP and cross environment Dataverse).

  1. Create Solution
  2. Create Publisher
  3. Add App to Solution
  4. Create Environment Variables
  5. Change Datasource to environment variable


1. Create Solution

First you need to create a solution to store your app in. In the solutions section of make.power.com click the New Solution button at the top of the screen.



In the side panel add your solution display name (this can be updated at anytime), the name, by default the display name with spaces removed (this can not be updated and must be unique).
Select your publisher, the publisher is , if you don't have one click the pencil to create one (next section explains how to create the publisher). 
Then select create, after short while you should appear in the new empty solution.

2. Create Publisher

As there are no owners of solutions, only owners of the components, a solution has a publisher. A publisher should be thought of the developer team that owns the solution, but it can be individual if you like.


Give your publisher a display name and name, just like a solution only the display name can be edited and the name can not have spaces.

The prefix is what is added to certain components, including environment variables, connection references, custom tables, and choices (this only happens if they are created in a solution with that publisher, else it will be created in the common data services solution and use the environment default publisher (normally Cr{random letters and numbers}).

The choice value prefix is the lead number for any choices (choices have display value and a number value), generally it is recommended to leave with the default created value.

To edit/delete a publisher goto the 'More' section in the left menu and click on publishers, here you will see a table of publishers.

3. Add App to Solution

Next you need to add your app to the solution, click on Add existing, select app and Canvas app.
   



You should then see of any apps you own that are already solution aware, as we don't want these click on Outside Dataverse, you will then see the app, select it and then click Add.




After a short while the app should appear in the solution.

4. Create Environment Variables

If your app has no data sources you can skip this step, but if you use SharePoint/SQL/SAP or cross environment Dataverse you will need to add environment variables so they can be switched when moving from dev to test to prod environments.
Click New, More, Environment Variables to create a new variable.



There are different types of variables, but in this case we are using data source only. You need to give it a display name (which you can change later), and a name (which cant be changed later by default will remove spaces and special characters from displayname). After selecting Data source from Data Type select SharePoint from the connector. 
For SharePoint you need a variable for the site and the list, always create the site first as it will be used in the list variable.

After selecting Site from the Parameter Type, you need to add the Current site (do not use default), you should see the site in the dropdown, but you can also paste in the site url, then click Save.



For the list variable repeat the create steps but select list from the Parameter Type. You will then see the Site dropdown appear, ensure you DO NOT select the site but your site environment variable, else this will fail when changing the site.
Again use the Current selection not default to select your list and then click Save. 



5. Change Datasource to environment variable

Now that you have the environment variables you need to update the app to use them instead of the hardcode site/list. Edit the app and first remove all data sources from the app. Don't worry if you see lots of errors, these will disappear when the lists are added back.



Follow the normal path to add the data, but this time do not use Recent sites but the Advanced tab. This will show you the list of environment variables not sites, select your site environment variable



You will then see all of the Lists for that site, do not select them here but again click the Advanced tab. You should then see all of the environment variables available for that site environment variable. Select the lists you want to add and click Connect.



After publishing your app the app will be fully solution aware and ready to be deployed across other environments,


______________________________________________________________________________________________

l also do long form and broader Power Platform blogs here https://dev.to/wyattdave

Comments