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 Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (1,841)