Tuesday, June 28, 2022

D365 Maintenance mode

This blog post provides information about maintenance mode in Finance and Operations. When maintenance mode is turned on, it provides a safe way for system administrators to make system changes that might affect system functionality. For example, configuration keys can be enabled or disabled. While maintenance mode is on, only system administrators and users who have the Maintenance mode user role can sign in to the system. By default, maintenance mode is turned off. 

Turn maintenance mode on and off on sandbox and production environments through Lifecycle Services

You can now turn maintenance mode on and off directly through Lifecycle Services (LCS) on your sandbox and production environments. Refer to the following steps to do this:

  1. Go to the environment details page and on the Maintain menu, click Enable Maintenance Mode.
  2. In the slider, set Turn maintenance mode on for the environment and select Confirm.
  3. A servicing operation will begin and your system will go into maintenance mode.
  4. On completion, the environment state will be In Maintenance. At this point, only the system administrator will have access to the environment.
  5. After you are done making system-wide changes, you can turn off maintenance mode by clicking Disable Maintenance Mode under the Maintain menu.
  6. This will start a servicing operation that takes your environment out of maintenance mode. You can see the progress of the operation in the environment details page.
  7. After this is complete, your environment goes back to the Deployed state. Now all users can sign in to the environment.
  8. You can check the environment history page to see when the maintenance mode was turned on or turned off. To get to the environment history page, select History and Environment changes on the environment details page.

Turning maintenance mode on and off for your sandbox and production environment is very similar to a servicing operation. If turning maintenance mode on or off fails, you will see options such as ResumeRollback, and Abort. You also have the option to download the logs to troubleshoot why the operation failed.

Turn maintenance mode on and off in DevTest/Demo environments hosted in Customer's subscription

  1. Establish an RDP connection to the developer machine.

  2. On the developer machine, sign in to SQL Server by using the credentials for the axdbadmin user from LCS. Then switch to the AXDB database, and run the following command.

    update SQLSYSTEMVARIABLES SET VALUE = 1 where PARM = 'CONFIGURATIONMODE'
  3. Restart the World Wide Web Publishing Service to reset IIS.

  4. After the service is restarted, the system will be in maintenance mode.

  5. When you've completed your maintenance mode activities, repeat steps 2 and 3, but set the value to 0 in step 2.

Turn maintenance mode on and off for VHD-based environments hosted by customers

You can turn on maintenance mode locally by running the following command.

K:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe

--metadatadir J:\AosService\PackagesLocalDirectory --bindir K:\AosService\PackagesLocalDirectory\Bin

--sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd ********* --setupmode maintenancemode

--isinmaintenancemode true

You can turn off maintenance mode locally by running the following command.

K:\AosService\PackagesLocalDirectory\Bin\Microsoft.Dynamics.AX.Deployment.Setup.exe

--metadatadir J:\AosService\PackagesLocalDirectory --bindir K:\AosService\PackagesLocalDirectory\Bin

--sqlserver . --sqldatabase axdb --sqluser axdbadmin --sqlpwd ********* --setupmode maintenancemode

--isinmaintenancemode false

After running the command, you will want to restart the World Wide Web Publishing Service to reset IIS. The system will then be in maintenance mode.

SQL user axdbadmin password can be obtained from LCS environment details page.



No comments:

Post a Comment