DEV Community

Cover image for Read Only Sharing in Power Automate
david wyatt
david wyatt

Posted on

Read Only Sharing in Power Automate

One of the big things missing in Power Automate is read only roles. At the moment if you want to share a flow for someone to look at or see the logs, you have to give them full edit access.

Not only is this a pain, it opens you up to being hacked (hacked-by-power-automate) and it means that you cant see what's happening in your production environments (if you have proper separation of duty, and you should).

Fortunately there is a clever workaround, but its not quite perfect because:

  • It only works on your production environments (i.e nothing can be created new in the environment)
  • Requires pre configuration of your Solutions (so you cant retrospectively add it)

The magic happens because of 3 key things:

  1. Managed Solutions stop you editing the flows
  2. Allow Customizations false stops editing through solution layers
  3. Basic Security Role allows access but no ability to make

And if you want to it is quite easy to automate it, leveraging the updating zip technique here update-contents-of-a-zip-file-with-power-automate, as a solution is just a zip.

1. Managed Solutions

This one is easy, when exporting the solution ensure it is set to managed (it is by default).

managed solution

To automatically do, you need to update the Solution.xml file. It looks something like below:

Part of the solution.xml file

<ImportExportXml version="9.2.23082.190" SolutionPackageVersion="9.2" languagecode="1033" generatedBy="CrmLive" xmlns:xsi="">
      <LocalizedName description="Text Based Game" languagecode="1033" />
    <Descriptions />
        <LocalizedName description="WyattDave" languagecode="1033" />
      <Descriptions />
Enter fullscreen mode Exit fullscreen mode

<Managed>0</Managed> needs to be updated <Managed>1</Managed>

2. Allow Customizations to false

The Power Platform allows something could 'Solution Layers' which just allow updates to managed flows and other components. It keeps the original flow but adds any edits on top. The main reason is for hotfixes (though I'm not a fan of any direct prod edits), as it allows you to remove the fix later (almost like version control).
What I don't like about this is it can trick people into thinking it is read only, as managed states that (not good for citizen developers who don't have time to read all the documentation).

Each component needs to be set individually from within the solution, under managed properties.

managed properties

customization false

This is also pretty easy to automatically update as its another plain text xml file, this time the Customizations.xml.

The customizations.xml lists all of the components of the solution (e.g. flows, Apps, Environment Variables, Connection References). Solution components are basically rows from each of the different Dataverse tables, so the customizations.xml file lists the kind of metadata for them in relation to the solution.

Flow Example

<ImportExportXml xmlns:xsi="">
    <Workflow WorkflowId="{f65502d4-6758-ee11-be6f-000d3a5a7615}" Name="Canyon Escape">
        <LocalizedName languagecode="1033" description="Canyon Escape" />
Enter fullscreen mode Exit fullscreen mode

Connection References Example

    <connectionreference connectionreferencelogicalname="wd_ConversionGame">
    <connectionreference connectionreferencelogicalname="wd_ExcelGame">
Enter fullscreen mode Exit fullscreen mode

<IsCustomizable>1</IsCustomizable> needs to be updated to <IsCustomizable>0</IsCustomizable>,
Strangely Connection References use a different tag (<iscustomizable>1</iscustomizable>, so no capital c), but it doesn't matter if these are update to false.

3. Basic Security Role

The Basic security role allows the user to see and edit rows they own, so for standard Dataverse tables they can create, read, update, delete their own entries. The other thing it gives is read only access to system rows they own (though they cant create, update, delete). And as solution components are just rows in Dataverse tables it means the role can give the read only access (as long as they are made the owner).

basic role

And that's it, the developer can now see the flow but not edit, and they can't create anything new in the environment. Plus they can't see any solutions or other components to edit (like Environment Variables and Connections) so change control is protected.

flow logs

One big call out though is the use of 'Secure Outputs', as these will need to be set if the flow is passing any confidential data. Its a pain as every action that brings in data will need to been set to secure to hash the data (hopefully Microsoft will introduce a Flow/Environment level setting to turn it on).

secure inputs

Top comments (1)

balagmadhu profile image
Bala Madhusoodhanan

let me try a bad version of Stewie Griffin - "Oh, splendid! A clever workaround for the lack of read-only roles in Power Automate. You’ve certainly outsmarted those incompetent so called pr-developers who struggle to implement such a basic feature. Bravo, sir, bravo!"

Love the article @wyattdave