I’ve been working on Dynamics Portals consistently over the past few years and one frustrating bit is the implementation of Website Site Settings.

Each Website that you configure within Portals has a series of Site Setting records that are essentially string key/value pairs, each record having a Name and Value, and an additional description.  For example, a simple true/false flag indicating whether Search is enabled:

Search/Enabled

Pretty simple, right? With other Site Settings, things become a bit more complex. Take a look at the settings required to set up external authentication, such as with Azure B2C. Here is an excellent post by Nick Doelman at readyxrm.blog where he provides detailed instructions on how to Configure Azure AD B2C for PowerApps Portals. Here is a list of settings from Nick’s post:

Authentication/OpenIdConnect/[Federation-Name]/DefaultPolicyId

Authentication/OpenIdConnect/[Federation-Name]/Authority

Authentication/OpenIdConnect/[Federation-Name]/PasswordResetPolicyId

Authentication/OpenIdConnect/[Federation-Name]/ ValidIssuers

Authentication/OpenIdConnect/[Federation-Name]/ExternalLogoutEnabled

OpenID Connect Site Settings

Nick does an excellent job describing the settings, so I won’t go into those details. What I will point out is that to configure a single feature, we have six related Site Setting records with special rules. For example, the ValidIssuers Site Setting is actually a delimited list of URLs (while the OnlineDomains Site Setting is delimited by semicolons!).

The Names in this list have some special rules, too. The segment of the name in bold [Federation-Name] is filled in using the Federated Name set from your Azure configuration. For example, an Azure Federated Name could be:

Authentication/OpenIdConnect/Azure B2C/DefaultPolicyId

OpenID Connect Site Settings

So with the Open ID Connect settings group, the Names follow a convention such that values are included in the Name itself.

While simple name value pairs makes storing the values easy, editing these more complex settings becomes complicated and open to error.

Portal Site Settings Manager

Nick actually suggested this as an XrmToolBox tool back in February while at the Boston 365 Saturday event. At the time, I did not have a handle on the complexities of the Site Settings values, but after reviewing his blog and setting things up myself for a Portal last week, the need for the tool became very clear!

This XrmToolBox Tool offers the following

  • View all Website Site Settings
    Selecting a Portal Website loads known Site Settings into a custom editor and all Site Setting records into a grid based view
  • Site Setting custom editor
    Both simple Site Settings like true/false values and complex Site Settings like OpenID Connect and OpenAuth custom editors and some validation. This ensures that both the values are in the correct format and special groups are edited as a whole
  • Preview changes
    Before committing any creates or updates, you can preview the pending changes
  • Selective update
    You can choose to create or edit Site Settings from the list of pending changes
  • Search and delete
    Filter and delete records from a simple Site Settings grid view. (A separate action protects us a bit from inadvertent deletes)

Using the new tool, an example of setting up Azure B2C would look like:

Open ID Connect Custom Editor

The corresponding Site Setting records would be as follows:

Open ID Connect Site Setting Records

This list of available Site Settings should be pretty extensive, but some have not yet been added to the custom editor. As I continue to review the documentation, I’ll be adding the outstanding Site Settings to the custom editor.

Some shout outs

I’ve already mentioned Nick and his insanely helpful readyxrm.blog, but I also need to mention two others on this tool. Thanks to Jonas Rapp and his his CrmGridView control, I was able to add the list of all Site Setting records to my Tool with a few lines of code. If you have not used it yet, you can add it to your project using NuGet: xrmtb.XrmToolBox.Controls.

Because this tool means editing critical records in your Portal, I considered adding a back up feature for your Site Setting records. I realized that Tanguy Touzard already offers both export and import of select Portal records with his Portal Records Mover XrmToolBox tool. All I needed to do is add a link from my tool to open the Portal Records Mover and we can backup and restore Site Settings should we have any issues.

I was going to joke that I am really getting tired of having to thank these three guys. But this is yet another examples of the power (get it?) behind the Dynamics 365, Business Applications, and Power Platform community. This willingness of community members to share experiences, ideas, and solutions makes our work so much easier!

Open source!

The source code for the Portal Site Settings Manager can be found on Github here:https://github.com/jamesnovak/Futurez.XrmToolbox.PortalSiteSettings

I have published the Portal Site Setting Manager tool to the XrmToolBox Plugin Store so I hope it will be available soon!

I’ll be adding some notes with more detail to the read me, but for now, I believe the Tool should be fairly easy to use. If you have any suggestions or issues, drop me a line or add an Issue to the Repository.

0 Points


Leave a Reply

Your email address will not be published. Required fields are marked *