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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Handling Environment V...
Power Apps
Suggested Answer

Handling Environment Variables in Power Apps Solution for AppSource Deployment

(1) ShareShare
ReportReport
Posted on by 4

I have a Power Apps solution that uses environment variables for configuration.

When deploying this solution via AppSource, I want client installations to be able to set or configure these environment variables during or after installation.

What is the recommended approach to:


  • Include environment variables in an AppSource-ready solution

  • Allow clients to provide or override values during deployment

  • Ensure smooth configuration without manual post-deployment fixes

  •  
 

Are there any best practices or supported patterns for managing environment variables in AppSource-distributed solutions?

I have the same question (0)
  • Suggested answer
    11manish Profile Picture
    3,333 on at
    The correct and supported AppSource approach is:
    • Ship only environment variable definitions
    • Let customers set values during import or after install
    • Never hardcode or ship environment-specific values
    This ensures:
    • Secure deployment
    • Tenant-specific configuration
    • Smooth upgrades (values are not overwritten) 
       
  • Suggested answer
    Valantis Profile Picture
    6,735 on at
     
    The recommended pattern is well documented for this. Here is how it works.
    Include definitions, not values
     
    Add your environment variable definitions to your solution but remove the current values before exporting. Microsoft's own docs say: include definitions in the managed solution, let values be provided in the target environment. If you export values into a managed solution, clients can't update them without an upgrade operation, which is painful.
     
    To remove values before export: in your solution, select the environment variable, go to Current Value > ... > Remove from this solution. The definition stays, the value does not travel with the solution.
     
    What happens at install for AppSource customers
    When a client installs your solution and it contains environment variables without values, the import wizard automatically prompts them to fill in the values. This is the built-in mechanism for AppSource no custom code needed. Microsoft confirms this behavior: "If your solution contains environment variables, you'll be prompted to enter values" during import.
     
    For AppSource specifically, your solution goes through the Package Deployer. To give clients a smooth experience:

    1. Package your managed solution using Package Deployer (this is what AppSource requires anyway)
    2. Set sensible default values on environment variable definitions where possible, so clients only need to fill in environment-specific things like URLs or connection strings
    3. Add descriptions to each environment variable definition so clients know what to put in  this text shows in the import wizard
    Post-installation configuration
     
    f a value needs to change after install, clients can update environment variable values from the Default Solution in Power Apps maker portal, or directly in Power Platform admin center.
     
    Values are unmanaged records even for managed solutions, so they are always client-editable without needing a solution update from you.
    One thing to avoid: don't set values in your managed solution unless they are truly static and never need to change per client. Once a value is in a managed solution, removing it requires the client to run an upgrade operation, not just an update.
     
     
     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

    💼 LinkedIn

    ▶️ YouTube

  • Valantis Profile Picture
    6,735 on at

    Hi @SK-26031022-0,

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard