All Content
Timespan
explore our new search
Dataverse Environment Variable Export-Import Guide
Image Source: Shutterstock.com
Microsoft Dataverse
Sep 29, 2023 8:10 AM

Dataverse Environment Variable Export-Import Guide

by HubSite 365 about Temmy Wahyu Raharjo

Citizen DeveloperMicrosoft DataverseLearning Selection

Unlock the potential of Dataverse Environment Variable for efficient customization and better Application Life Management with our Microsoft expert.

The blog post by Temmy Wahyu Raharjo delves into the concept of Dataverse Environment Variable for improved customization. In essence, Environment Variable acts as storage to hold values that you leverage for your customizations. This has now become the sanctioned method for data storage, over the previously favored approach, creating a custom table.

Dataverse Environment Variable enhances the Application Lifecycle Management by enabling the placement of the record in a solution. It also proves to be versatile in terms of the supported data types- String, Number, Boolean, JSON, Data Source, and Secret.

Raharjo elaborates further with an example of two environments – 'temmydev1' for the Development environment, and 'temmydev2' for SIT environment. The goal was to relocate the 'Demo Pipeline Solution' from 'temmydev1' to 'temmydev2'. The default value assigned to the Environment Variable named 'Demo Environment' appears as a JSON.

The solution was then imported into 'temmydev2' with the aid of Power Platform Pipeline, employing an "Update a solution" approach. This means the existing value of the environment variable value can be replaced within the 'temmydev2'.

Whilst satisfied with the state of his component, Raharjo decided to check the state of the Environment Variable Definition which remains under "managed" without any customization applied. He then proceeded by creating an Environment Variable Value to replace the Current Value of the Environment Variable back in 'temmydev1'.

Raharjo cautions against exporting this value to another environment, as it may cause the previously set value in 'temmydev2' to be substituted with the value from 'temmydev1'.

Conclusions

In conclusion, the takeaway from Raharjo’s post is the importance of using 'Default Value' while you're in the Development instance when utilizing Environment Variable. Simultaneously, for a higher environment, one should craft a fresh Environment Variable Value to substitute the value from Development.

If an Environment Variable Value is created in your Development setting, and the component is moved to a higher environment, the value from the higher environment gets replaced by the value from Development. To avert this, it is best to do away with the value in Development ahead of re-importing to the targeted Environment; the current value of the target environment will then be removed, and a new value can be safely created.

Read the full article About Dataverse Environment Variable Export-Import

Microsoft Dataverse - Dataverse Environment Variable Export-Import Guide

Learn about About Dataverse Environment Variable Export-Import

Understanding the Dataverse Environment Variable feature is crucial for anyone working with the dynamics of Microsoft Advanced Data Management Systems. This feature allows users to conveniently store values for their unique customizations, which previously were stored in custom tables, such as [your_prefix]_configuration/[your_prefix]_generalsetup. Now, there’s an official, much more efficient method.

The utility of the Environment Variable is multifold. The records of the Environment Variable can be contained within a solution (Solution Aware), simplifying the Application Lifecycle Management (ALM) process by enabling convenient shifting of the component from one environment to another. This brilliant feature supports several data types, including String, Number, Boolean, JSON, Data Source, and Secret. Certain data types such as Data Source and Secret have yet been unexplored and might be considered for future use.

To further elaborate, let’s consider an example involving two environments: temmydev1, utilized for the Dev environment, and temmydev2, which is used for the SIT environment. If we wish to transfer the “Demo Pipeline Solution” from temmydev1 to temmydev2, we would define an Environment Variable named “Demo Environment.” For this instance, the default value might be ‘{ “message”: “Hello world from Temmy Dev 1 – Current Value” }‘.

Moving forward, we import this solution to temmydev2 using Power Platform Pipeline. Curiously, the Import mode of Power Platform Pipeline uses the “Update a solution.” During this process, the Environment Variable Value is created in temmydev2 to replace the existing value, irrespective of the state of the Environment Variable Definition, which remains “managed,” and no customizations have been applied.

Reverting back to temmydev1, a new Environment Variable Value is created to replace the Current Value of the Environment Variable. However, there would be a warning stating “Remove this value before exporting if it shouldn’t be used in other environments.” If ignored and the solution is imported to temmydev2, the previously created value would be replaced with the new value from temmydev1.

In conclusion, the key learning from this discussion is that if you are considering utilizing Environment Variables, ensure to always use “Default Value” while in the Dev environment. While in higher environments, create new Environment Variable Value to replace the Dev environment value. If in the Dev environment, you are creating Environment Variable Value and this component is imported to a higher environment, you will encounter issues as the higher environment value will be replaced by the Dev value.

To prevent this, delete the current value in Dev > re-import to the target environment > the Current Value of the target environment will be erased, making it safe to create a new value. Happy CRM-ing!

Microsoft Dynamics 365 Technical Consultant, KL Power Platform User Community Leader, Test Driven Development Enthusiast, and Human Code Enthusiast - temmyraharjo

More links on about About Dataverse Environment Variable Export-Import

About Dataverse Environment Variable Export-Import
Apr 1, 2023 — Basically, Environment Variable is a table where we can store a value that we will use for our customizations. Where the popular way to do it in ...
Use environment variables in solutions - Power Apps
Jul 13, 2023 — Ensure the solution containing the environment variable is imported to the destination environment before your current solution is imported.
About Dataverse Environment Variable Export-Import
Apr 1, 2023 — Dataverse Environment Variable Export-Import allows users to save and share their Dataverse environment variables. It allows users to easily ...

Keywords

Dataverse Environment, Variable Export-Import, Environment Variables, Dataverse Export, Dataverse Import, Dataverse Variables, Variable Management, Import Export Variables, Environment Management Dataverse, Dataverse Environment Control