if you are new to Power Apps Code Apps, refer to article: Building Code App
While pushing the code app using pac code push , you might encounter the following error:
Error: The environment config does not match the current environment.

Reason and Fix:
This issue can occur when the Power Platform Environment ID stored in your Code App doesn’t match the environment in your current pac authentication profile.
- Open the power.config.json file in your code app project.
- Note the environmentid specified in the file.

- Now open a command prompt and run:
pac auth list

- Verify that the
*is associated with the same environment referenced by the Environment ID inpower.config.json. - If a different environment is selected, switch to the correct one by running:
pac auth select -i {Your Environment Row Number from pac auth list}

- Retry publishing the code app using pac code push
That should resolve the “The environment config does not match the current environment” error.
🙂



Leave a Reply