共用方式為


How to: Deploy a Microsoft Dynamics NAV Database to Azure SQL Database

This topic describes how you can deploy a Dynamics NAV database to Microsoft Azure SQL Database.

To deploy a Dynamics NAV database to Azure SQL Database, the database must be exported as a data-tier application (DAC) file, which is known as a .bacpac file. This can be performed by using SQL Server Manager, as described in this topic.

Important

To optimize, we recommend that the Microsoft Dynamics NAV Server instance that connects to the database is deployed on a virtual machine in Azure. Additionally, the virtual machine and SQL Database must be in the same Azure region.

Prerequisites

Make sure that you have the following prerequisites for completing this procedure:

  • A Microsoft Azure subscription and access to the Azure Portal.

  • A Dynamics NAV database installed on a SQL Server Database Engine instance.

  • SQL Server Manager is also installed on the same computer.

  • Access to the Dynamics NAV installation media (DVD).

Create and configure an Azure SQL Database Server

In the Azure Portal, create an SQL Database Server for hosting the Dynamics NAV database. For more information about how to create and configure an SQL Database server, see Create your first Azure SQL Database.

Here are some important notes when creating the Azure SQL Database:

  1. You must specify a login name and password for the server. You will use this information in the next steps when you deploy the Dynamics NAV database to Azure SQL and set up the Microsoft Dynamics NAV Server to authenticate with the database.

  2. Configure the server to allow for access by Windows Azure Services.

  3. Make a note of the SQL Database server name because you will need it later.

    The name has a format similar to this: mysqldatabaseserver.database.windows.net.

  4. Configure the SQL database server firewall to allow for access by the IP address of the computer that you are using to deploy the Dynamics NAV database.

    For information, see How to: Configure Firewall Settings (Azure SQL Database).

Prepare the Dynamics NAV Database

Make sure the database meets these requirements:

  1. Delete all users of the database that use Windows authentication.

    This includes NT AUTHORITY\NETWORK SERVICE and NT AUTHORITY\SYSTEM. Only users with SQL authentication are allowed in Azure SQL Database.

  2. Upload a valid Dynamics NAV license file to the database.

    For more information, see Uploading a License File for a Specific Database.

  3. Delete the deadlock monitors for the Dynamics NAV database.

    You can do this in SQL Server Management Studio by running a query similar to the following:

    use [Demo Database NAV (11-0)]
    
    DROP VIEW [dbo].[deadlock_report_ring_buffer_view]
    

    For more information about the deadlock monitor, see Monitoring SQL Database Deadlocks.

Export Business Central Database to a BACPAC File (.zip file)

When you deploy your application online, you must provide a compressed .zip file that contains the database as data-tier application file, known as BACPAC (.bacpac) file. This article describes how you to create the BACPAC files and zip. You can do this using SQL Server Management Studio.

  1. In SQL Server Management Studio, connect to the server instance that hosts the database.

  2. In Object Explorer, right-click either the database, choose Task, and then choose Export Data-tier Application.

  3. Follow the steps in the Export Data-tier Application wizard to export the database to a .bacpac file on your computer or network.

    You can use any name for the .bacpac file.

    For more information about exporting databases to .bacpac format, see Export a Data-tier Application.

Import the BACPAC to Azure SQL

  1. In SQL Server Management Studio, connect to Azure SQL Database server that you created.

    1. Select File > Connect Object Explorer.

    2. In the Server Name, enter the server name assigned to your Azure SQL Database server.

      For example, *mysqldatabaseserver.database.windows.net. You can get this from the Overview page in the Azure portal.

    3. Enter the login name and password that you set up in the first task when creating the Azure SQL Database server.

  2. Import the BACPAC file that you created for the Business Central Database.

    1. In Object Explorer, right-click the Database folder, and select Import Data-tier Application.
    2. Follow the wizard. On the Import Settings page, browse for the BACPAC that you create, and choose Next.
    3. Review the Database Settings page. Make changes if needed, and then choose the Next > Finish.

Configure the SQL Server Authentication on the Microsoft Dynamics NAV Server instance

The last step is configure SQL Server Authentication on the Microsoft Dynamics NAV Server instance. For the database credentials, use the login name and password that set up when you created the Azure SQL Database server.

For more information, see Configure SQL Authentication on the Database.

The Dynamics NAV database is now deployed and configured on Azure. For developing, you can connect to the database from the Microsoft Dynamics NAV Development Environment.

Changing database login account database

If you want to use a different login account for the database, to the following:

  1. Create a new login that uses SQL Server authentication.

    For more information, see Create a Login.

  2. Map the login to a user in the Dynamics NAV database, and add the user to the db_owner role of the Dynamics NAV database.

    For more information, see Create a Database User.

See Also

Configuring Database Components
Configuring Microsoft SQL Server
Transparent Data Encryption (TDE)