Issue with pac code init --displayName with Code apps in powerplatform
07:23 20 Mar 2026

I am trying to initialize a Power Apps code app in an environment where code apps is enabled.

I run into an error when i run pac code init --displayName "PROJECTNAME".

Error during CLI execution: Error: Environment 'ENVID' not found. Please verify the environment ID and ensure you have access to it.

What I verified:

pac env who succeeds and resolves the target environment correctly

environment is not managed/restricted in a way that should block us that i can see.

user permissions are correct

tested in more than one environment all the same results.

Observed behavior:

the newer npm CLI flow documented on Learn also does not work as documented in our setup

Environment details:

PAC version: 2.4.1

This seems like potentially something backend but no idea what. I have enabled code apps and i have the correct permissions. I am admin on the environment.

Could anyone confirm whether code apps requires any tenant-side allowlisting or additional enablement beyond the environment feature toggle?

I am using visual studio code when trying to do this. I get the same when i run in Powershell as well.

Thanks

powerapps power-platform