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
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.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (4,244)