Announcements
Hello! I am giving RSAT a try and after following along with the user manual (included in the download: https://www.microsoft.com/en-us/download/details.aspx?id=57357) without any trouble, I have gotten to the point of running my test case. My test case is failing with the error pasted below. I have emphasized what I believe to be the important parts.
My question is that I am unable to determine exactly what this error is referring to and thus how to fix. My environment is on PU 21.
Some investigations I have already tried:
Thank you for your recommendations and expertise!
I feel my RSAT configuration settings are accurate, but I will share a redacted version just in case:
<?xml version="1.0" encoding="utf-16"?>
<Error xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns:xsd="www.w3.org/.../XMLSchema">
<ExceptionType>System.TypeInitializationException</ExceptionType>
<Message>The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement' threw an exception.</Message>
<StackTrace> at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement.get_AdminUser()
at MS.Dynamics.Performance.Application.TaskRecorder.Create_an_Asset.TestSetup(Boolean verboseSnapshotsEnabled)</StackTrace>
<InnerError>
<ExceptionType>System.TypeInitializationException</ExceptionType>
<Message>The type initializer for 'MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserContext' threw an exception.</Message>
<StackTrace> at MS.Dynamics.TestTools.CloudCommonTestUtilities.RainierRuntimeConfig.Configure()
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserManagement..cctor()</StackTrace>
<InnerError>
<ExceptionType>System.InvalidOperationException</ExceptionType>
<Message>Could not add role(s) TestEssentialsRole to AX user $00BD (testuser@microsoft.com)</Message>
<StackTrace> at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.DynamicsUser.AddSecurityRoles(String[] roles)
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.KnownIdentity.get_SystemUser()
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserContext..ctor()
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.UserContext..cctor()</StackTrace>
<InnerError>
<ExceptionType>System.ServiceModel.FaultException`1[System.ComponentModel.Win32Exception]</ExceptionType>
<Message>Bad Request</Message>
<StackTrace>
Server stack trace:
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at MS.Dynamics.TestTools.CloudCommonTestUtilities.AxUserManagementServiceReference.IAxUserManagement.ModifyUserRoles(AxUser user)
at MS.Dynamics.TestTools.CloudCommonTestUtilities.Authentication.DynamicsUser.AddSecurityRoles(String[] roles)</StackTrace>
</InnerError>
</InnerError>
</InnerError>
</Error>
Hi,
You need to enable the TestEssentialsRole on the system Security configuration -
you will find it here -
Ok, good thing you managed to workaround the issue. Other than making sure the package is also loaded I feel like troubleshooting this could take a lot of time.
But yes you are correct, it will lookup the AOT name for the role.
I have not been able to figure out how-and-why the 'TestEssentialsRole' role in the 'TestEssentials' model is not being recognized by my system. As a work around, I duplicated the 'TestEssentialsRole' and 'TestEssentialsPrivilege' from the 'TestEssentials' model to a different model (naming them "xxx_Test"), and compiling-and-syncing that model created the "xxx_Test" versions just fine. I still received the error, however, as I guess the RSAT tool does a lookup by AOTNAME. Therefore, I changed my 'TestEssentialsRole_Test" AOTNAME to be 'TestEssentialsRole' and now everything works just fine.
Obviously, this is not a valid solution for a production implementation, but I am only POC'ing the RSAT tool and if we decide to move forward, I will be raising the issue with a Microsoft ticket. Cheers.
I have, yes. No changes occurred.
Ok, did you also try to run Synchronize All function from System administration > Security > Security configuration > Data?
Thank you Erik - yes, I confirm the testuser@microsoft.com account is being created. No, it is not getting the 'TestEssentialsRole' --- nor am I able to assign the role myself; it does not appear as an option for roles. I confirm the TestEssentials model is present, compiled, and sync'd. The model has the 'TestEssentialsRole' role and 'TestEssentialsPrivilege' privilege. Both are set to Enabled = Yes and IsObsolete = No. And yet, I cannot get them to display as roles. I found this community post (https://community.dynamics.com/ax/f/33/t/246036), but adding labels has not helped.
The testuser@microsoft.com user should automatically be created when you run your test cases, if it doesn't exist already, and it will automatically set the TestEssentialsRole. For some reason this fails. If the role already exists on the user it should in theory not try to set this again. Can you check the user and see if the role is already set, if not can you check if you can set the role manually?
André Arnaud de Cal...
293,296
Super User 2025 Season 1
Martin Dráb
232,093
Most Valuable Professional
nmaenpaa
101,156
Moderator