Modifica

Configure Business Central Server

APPLIES TO: Business Central 2022 release wave 2 (version 21) and later. For earlier versions, refer to Configuring Business Central Server in outdated versions.

When you run Business Central Setup and install Business Central Server, you provide information that is then used as the configuration for the default Business Central Server instance. This information is stored in a configuration file for the server instance called CustomSetting.config. The default location of the CustomSettings.config file is C:\Program Files\Microsoft Dynamics 365 Business Central\NNN\Service. Each Business Central Server instance has its own CustomSettings.config file.

After you install Business Central Server, you can change any of the settings, including other settings that weren't available to you in Setup.

Note

For a complete reference of server instance settings, including descriptions, default values, and dynamic update information, go to Business Central Server instance settings.

Configure Business Central Server using Setup

To install and configure the default Business Central Server instance, run Business Central Setup (setup.exe) and select one of these options:

  • Demo Option
  • Server Option
  • Developer Option
  • Customize > Server

Depending on your selection, the Specify parameters page lets you configure several settings. Learn more in Installing Business Central using Setup.

Configure Business Central Server after installation

After you install Business Central Server, you can change the configuration settings in the CustomSettings.config file of a Business Central Server instance in the following ways:

Configure server instance with Business Central Administration Shell

The Business Central Administration Shell includes Set- cmdlets for creating and modifying Business Central Server instances. Use the Set-NAVServerConfiguration cmdlet to change the settings listed in Business Central Server instance settings. Specify the setting's Key Name in the -KeyName parameter and its new value in the -KeyValue parameter.

  1. Start Business Central Administration Shell for your current version as an administrator.

    For more information, see Run Business Central Administration Shell.

  2. Run the following command:

    Set-NAVServerConfiguration -ServerInstance "<InstanceName>" -KeyName "<KeyName>" -KeyValue "<Value>"
    

    Replace:

    • <InstanceName> with the server instance name.
    • <KeyName> with the setting's key name.
    • <Value> with the new value for the setting.

    For example, the following command changes the database used by the MyInstance server instance to Database-B:

    Set-NAVServerConfiguration -ServerInstance "MyInstance" -KeyName "DatabaseName" -KeyValue "Database-B"
    

Restart Business Central Server after modifications

There are a could factors that determine whether you must restart the server instance after you make changes before they take effect.

  • If you modify the CustomSettings.config file directly, you must restart the Business Central Server instance before any changes can take effect.

  • If you use the Business Central Administration Shell, the Set-NAVServerConfiguration cmdlet doesn't always require restarting the server instance.

    It depends on the configuration setting that you change. There are several settings that are dynamically updatable. Dynamically updatable means that a server instance restart isn't necessarily required after modification. Learn more in Modifying dynamically updatable settings.

    These settings are indicated by the text Dynamically updatable: Yes in Business Central Server instance settings.

Restart with the Services console

  1. Search for and open Services (services.msc).
  2. Find Microsoft Dynamics 365 Business Central Server InstanceName], like Microsoft Dynamics 365 Business Central Server BC280.
  3. Right-click and select Restart.

Restart using admin shell

  1. Start Business Central Administration Shell for your current version as an administrator.

    For more information, see Run Business Central Administration Shell.

  2. Run the following command:

    Restart-NAVServerInstance -ServerInstance "<InstanceName>"
    

    Replace <InstanceName> with the server instance name.

Modify dynamically updatable settings

For dynamically updatable settings, use the -ApplyTo parameter to specify how to apply the change. The change can be written directly to the configuration file (CustomSettings.config) and applied to the current server instance state. The option you choose determines whether a server instance restart is required for the change to take effect. The parameter has three options, as described in the following table:

Option Description
ConfigFile Saves the change to the configuration file of the server instance. The change doesn't take effect until the server instance is restarted.
Memory Applies the change only to the server instance's current state. The changes take effect immediately, without having to restart the server instance. The change is stored in memory. The next time the server instance is restarted, it reverts to the setting in the configuration file.
All Applies the change to the server instance's current setting state (in memory) and to the configuration file. The changes take effect immediately, without having to restart the server instance.

For example, the following command sets the value for the MaxStreamReadSize key to 42424242, without having to restart the server instance.

Set-NAVServerConfiguration -ServerInstanceMyInstance -KeyName MaxStreamReadSize -KeyValue 42424242 -ApplyTo Memory  

Learn more about running the Business Central Administration Shell in Business Central PowerShell cmdlets.

Configuring Business Central Web Server Instances
Business Central Server Administration Tool
Enhancing Business Central Server Security
Business Central Windows PowerShell Cmdlets
Configuring Help
Hiding UI Elements
Debugging