Monsieur Winner

MS D365FO || Monsieur D365FO

On-premises

Cannot Login after database refresh dynamics 365 FO on Premise

It is quite easy to do an SQL DB backup and restore. This happens often on a D365FO on-premises deployment from Production to UAT.

It gets a bit funnier when after the restore I get the message :

D365FO : You are not authorized to login with your current credentials. You will be redirected to the login page in a few seconds.

Me: Do you realize I am an administrator ? In fact, I deployed this environment so I need access now !!!

Well, few things to do.

  • Run the Reset-DatabaseUsers.ps1 script in the infrastructure folder

.\Reset-DatabaseUsers.ps1 -DatabaseServer ‘<FQDN of the SQL server>’ -DatabaseName ‘<AX database name>’.

  • Update the networkdomain to the adfs federation service name https://fsn.contoso.com/adfs.
If you are still unable to login, then the just restored DB  did not probably Sync.
You can run a manual DB Sync on an AOS node with the following script.

A.

Go to the AXSFType directory :

cd C:\ProgramData\SF\PR-AOS-2\Fabric\work\Applications\AXSFType_App7\AXSF.Code.1.0.20240111\Packages\bin.\Microsoft.Dynamics.AX.Deployment.Setup.exe -bindir

B.

“C:\ProgramData\SF\pr-aos-2\Fabric\work\Applications\AXSFType_App7\AXSF.Code.1.0.20240111\Packages” -metadatadir “C:\ProgramData\SF\pr-aos-2\Fabric\work\Applications\AXSFType_App7\AXSF.Code.1.0.20240111\Packages” -sqluser “axdbadmin” -sqlserver “XXX” -sqldatabase “axdb” -setupmode “sync” -syncmode “fullall” -isazuresql “false” -sqlpwd “yourdbPass

Replace the portions in bold based on your environment.

Once DB Sync is completed successfully , Happy on-premising :D.

Komi Siabi

Komi Siabi is a Bilingual D365FO Solution architect who loves sharing his knowledge as he works on Both Francophone and Anglophone projects around the globe. He enjoys doing some tiktok videos in his leisure time.

Leave a Reply

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