Home » Dynamics 365 » D365FO Maintenance mode

D365FO Maintenance mode

posted in: 365 Viking, Dynamics 365 0

DS365 for Finance and Operation

Maintenance Mode

Whenever there is a need to change the configuration key the system in question needs to be set to maintenance mode. When the system is in maintenance mode only users with the “System Administrator” role for their user account can access the system. Other users will see an error message saying that the system has been locked out for system maintenance and can only be accessed by administrators.

!! Note !!
After turning the maintenance mode on or off you need to restart the AOS

How to turn on maintenance mode?

There are few ways to turn the maintenance mode on and off all depending on the environment and where it is hosted. This blog will show you how to do it for:

  • Sandbox and production
  • Development and test in the Microsoft subscription
  • Development and test in the customer subscription and VDH hosted/based

Sandbox (Tier 2) and production environment

For sandbox and the production environment administrators use LCS to turn the maintenance mode on and off.

Navigate to the environment details page for the system you want to make changes in and under the “Maintain” menu you will find the option “Enable maintenance mode

After the slider has been activated and you close the dialog you will notice a maintenance service starting in the LCS portal for the environment. This is like any other service/maintenance for environments and the service in LCS. You will receive email notification when the operation starts and then another email when the operation has finished.

Development and test environment hosted in the Microsoft subscription

To turn the maintenance mode on or off for Dev/Test environments in Tier 1 you need to logon to the virtual machine with Remote Desktop and open the “SQL Server Management studio” and execute the following SQL statement. Make sure to connect to the correct database before executing the statement

-- Turn on maintenance mode
update SQLSYSTEMVARIABLES SET VALUE = 1 where PARM = 'CONFIGURATIONMODE'
-- Turn off maintenance mode
update SQLSYSTEMVARIABLES SET VALUE = 0 where PARM = 'CONFIGURATIONMODE'

Development and test environment hosted in the customers subscription or VDH based VMs

Turning the maintenance mode on or off can be done by running the following commands

// Turn on
J:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --metadatadir J:\AosService\PackagesLocalDirectory --bindir J:\AosService\PackagesLocalDirectory\Bin --sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd ********* --setupmode maintenancemode --isinmaintenancemode true
// Tuen off
J:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe --metadatadir J:\AosService\PackagesLocalDirectory --bindir J:\AosService\PackagesLocalDirectory\Bin --sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd ********* --setupmode maintenancemode --isinmaintenancemode false

The following table list the available parameters

arameter nameDescription
–setupmode maintenancemodeUse this parameter to inform the setup tool that the system will be put into or taken out of maintenance mode.
–metadatadirUse this parameter to specify the metadata directory. You should use the default packages directory.
–bindirUse this parameter to specify the binaries directory. You should use the default packages directory.
–sqlserverUse this parameter to specify the Microsoft SQL Server. For one-box environments, use a period (.).
–sqluserUse this parameter to specify the SQL Server user. You should use AOSUser.
–sqlpwdUse this parameter to specify the SQL Server password.
–isinmaintenancemodeUse this parameter to turn configuration mode on or off. Use true to turn it on and false to turn it off.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.