In this post, I will explain how you can move all user and security settings using data entities with Microsoft Dynamics 365 Finance and Operations. There are several ways to move the users and the security settings. I will focus this blog on the data management features.
Options to move user and security settings
When we talk about moving user and security settings, we can define the different types of settings:
- Security role assignments
- Security role, duty and privilege configurations
There are data entities for the users and role assignments. These are developed to be used with data management and are also enabled as public, so you can use the Excel add-in or other OData endpoints like Microsoft Power Automate.
The changes on security roles can be moved using deployable packages in case they were changed using the development environment. If you did customize the security using the Security configuration form, you have two options: Use the export and import from the security configuration form or data management.
What to use would be based on your own preferences. There is no real best practice as all options are created by Microsoft and thus supported. One advantage of using data management would be the option to have all user and security settings moved at once on the same moment.
As scenario for this blog, I started to have two equal environments which represents a test and a production environment. A new role with some standard and new duties and privileges is created for the Internal sales employee. The highlighted security artifacts have been customized using the Security configuration form.
Also a new user is setup which got this role assigned. Next to the security role assignment, there are organizations assigned to limit the access to two legal entities only.
Move user and security settings
When making the changes as mentioned above, we now want to synchronize all security from the test environment to the production. For that purpose, you can create a data management export project like shown below.
While adding the data entities, you can expect some information and warning messages. You can ignore them initially. Only when the data related to a specific security object is too large, the data can be truncated. This would cause an error or inconsistencies when you import the data package. I haven’t seen this happening yet in my projects.
A brief explanation of the used entities:
|User information||Data entity containing the users with user options.|
|Security privilege metadata customization entity||Data entity to export and import privileges which are added or changed using the configuration option.|
|Security duty metadata customization entity||Data entity to export and import duties which are added or changed using the configuration option.|
|Security role metadata customization entity||Data entity to export and import security roles which are added or changed using the configuration option.|
|Security user role association||Data entity for handling the security role assignments to users.|
|SystemSecurityUserRoleOrganizationEntity||Data entity for handling the organization assignments to security role assignments.|
|Security segregation of duties rule||Data entity for the segregation of duties rules.|
|Security segregation of duties conflict||Data entity for the segregation of duties conflicts. This entity has unresolved, but also reviewed conflicts.|
You may want to use these entities all together or work with single or some entities at a time. At least, you need to ensure the data you move will be consistent. It had e.g. no use to import Security user role associations when the corresponding security role or user is not in the target application.
Using the level and sequence, you can set dependencies to ensure data will be processed in a certain order and that some data will not be imported before certain entities are fully executed. You can read more about the sequencing on Microsoft Docs. To be honest, I did not set the correct order for the segregation of duties entities. I realized it when typing this blog.
When the export project is ready, you can Export the data directly or using the batch framework. When you have larger number of users, customizations and role assignments, executing in the background is recommended.
When the export is completed, you can download the package. When you enabled the option on the export project to directly create the package, the application will directly create a data package file on the Dynamics 365 storage for download. When you have not used that setting, it will ask you to create the package file before you can download it. You can save the package file which can be used to import in another environment. You save it on your preferred location and can rename the zip file.
In your other environment, you can create a new data management import project and load the data package file.
You can start the import directly or via the batch framework. The same recommendation applies like mentioned above for the export. If you have larger number of records, it would be better to run the import in the background.
After the execution succeeded, you can see the result and compare it with the expectations. The total number of records per entity are the same. In this case the Created column shows the new records created for the new user, security role with details and role assignments.
The security configurations which were not in the target environment initially are not only imported; they have been directly published and the security role is ready to be used without additional user interaction.
There is more…
There are two more data entities related to the security available out of the box. I haven’t used them in the example above.
|Active Directory Security groups||You can use this entity when you want to export or import the Azure Active Directory Security Groups. The related feature needs to be activated via a license configuration first. You can learn more how to use Azure Active Directory Groups for maintaining security in my blog post on this topic.|
|System security user role organization||The name of this entity is misleading. It is not interacting with the organization setup. Actually, this entity is almost the same as the data entity Security user role association. This entity is having an additional column for the license type related to the security role. The entity which can export and import organization assignment on security role assignments is mentioned above and has the name SystemSecurityUserRoleOrganizationEntity.|
When you are using the automatic role assignment rule for managing security access for users, you will find out that there is today no data entity available to export and import these configurations. To be able to have one in a future release, I created a new suggestion on the Dynamics 365 Application Ideas website. You can vote for this idea to get it prioritized by Microsoft.
I do hope you liked this post and will add value for you in your daily work as a professional. If you have related questions or feedback, don’t hesitate to use the Comment feature below.
That’s all for now. Till next time!