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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (5,792)