cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jamesyang
Helper I
Helper I

How to read environment variables by any users

Hello,

our managed solution uses environment variables. Our web resource pages uses these variables. An admin user can access them in our Web Resource pages, but a regular user receives this error

Principal user is missing prvReadEnvironmentVariableDefinition privilege on OTC=380 for entity 'environmentvariabledefinition'. 

 in our web resource page.

 

does anyone know how to fix the issue? one idea is to grant a read permission of  theenvironmentvariabledefinition  entity to every users. however, this is not a secure.

 

thoughts?

thanks

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @jamesyang ,

I agree with @jlindstrom 's thought almost. Actually, the Environment variables in CDS would be stored in environmentvariabledefinition and environmentvariablevalue entities. Please check the following article for more details:

https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/environmentvariables#security

 

Regarding the issue that you mentioned, please make sure the Security Role the regular user is assigned with has sufficient permission to access environmentvariabledefinition and environmentvariablevalue entities.

 

Please refer to the following screenshot, and assign proper privilege of environmentvariabledefinition and environmentvariablevalue entities to the Security Role which your regular user is assigned with:

5.JPG

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2

go to the user's security role

go to custom entity tab.

Grant read permission to these two entities

jlindstrom_0-1595901672917.png

@jamesyang  if this answers your question, please mark it a solution

 

v-xida-msft
Community Support
Community Support

Hi @jamesyang ,

I agree with @jlindstrom 's thought almost. Actually, the Environment variables in CDS would be stored in environmentvariabledefinition and environmentvariablevalue entities. Please check the following article for more details:

https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/environmentvariables#security

 

Regarding the issue that you mentioned, please make sure the Security Role the regular user is assigned with has sufficient permission to access environmentvariabledefinition and environmentvariablevalue entities.

 

Please refer to the following screenshot, and assign proper privilege of environmentvariabledefinition and environmentvariablevalue entities to the Security Role which your regular user is assigned with:

5.JPG

 

Regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Top Kudoed Authors
Users online (2,459)