How to: Deploy Microsoft Dynamics NAV on Microsoft Azure by Using the Example Scripts
This topic describes how to deploy Dynamics NAV by using the Example-1VM.ps1 and Example-2VM.ps1 scripts that are available with the Microsoft Dynamics NAV Provisioning Tools for Microsoft Azure. The scripts deploy Dynamics NAV in different network topologies. For more information, see Deploying Microsoft Dynamics NAV Using the Example Scripts.
To deploy Dynamics NAV by using the scripts, you must follow the steps as described in this topic:
Modifying the Parameter Settings
Modifying the Parameter Settings
The provisioning tools include the Set-PartnerSettings.ps1 script, which by default is located in the WindowsPowerShellScripts\Cloud\HowTo folder on the Dynamics NAV installation media (DVD). The Set-PartnerSettings.ps1 script contains parameters that are used by the -1VM.ps1 and Example-2VM.ps1 scripts to configure the Dynamics NAV deployment. For example, the Set-PartnerSettings.ps1 file contains parameters that specify the Microsoft Azure subscription, Dynamics NAV DVD location, security certificates, and more. Before you run the Example-1VM.ps1 or Example-2VM.ps1 script, you must modify Set-PartnerSettings.ps1 to provide values for all the parameters.
There are two ways to modify the parameters. You can modify the Set-PartnerSettings.ps1 file directly, or you can create a copy of the Set-PartnerSettings.ps1 file, and then modify the copy. Creating a copy of the Set-PartnerSettings.ps1 file is the preferred method, especially in a testing environment, because it enables testers to specify and save different parameter values without having to change the Set-PartnerSettings.ps1 every time.
Note
The procedures in this section use Windows PowerShell Integrated Scripting Environment (ISE) because if its script running, writing, and debugging capabilities. You can use Windows PowerShell if you prefer.
To configure the parameters in the Set-PartnerSettings File
If you have not already done this, prepare for the deployment.
For more information, see Preparing for Deploying Microsoft Dynamics NAV on Microsoft Azure.
On the computer that you will use to provision Dynamics NAV on Azure, run the Windows PowerShell environment as Administrator.
Important
You must run Windows PowerShell ISE or Windows PowerShell as an Administrator; otherwise the scripts will not execute correctly.
At the command prompt, change to the Cloud\HowTo folder of the provisioning tools. For example, enter the code:
cd <rootdrive>:\Cloud\HowTo
Substitute
<rootdrive>
with the drive letter on your computer.On the File menu, open the Set-PartnerSettings.ps1 file.
The script is located in the HowTo directory.
To create a copy of the Set-PartnerSettings.ps1 file for editing, do the following:
On the File menu, choose Save As.
Save the file in the same folder as the Set-PartnerSettings.ps1 and give it the name Set-PartnerSettings-CUSTOM.ps1.
Because you save it in the same folder as Set-PartnerSettings.ps1, the Set-PartnerSettings-CUSTOM.ps1 is automatically loaded by the example scripts.
Note
By default, the example scripts search the Cloud\HowTo folder for files that contain the text "custom" in the file name, so it is important that only one custom settings file is included in the folder when you run the scripts.
Open Set-PartnerSettings-CUSTOM.ps1, and then set the parameters as follows.
By default, parameters are commented lines that are preceded by
# TODO
.To set a parameter, delete the
# TODO
, and then provide a value for the parameter. For example, the following line of code contains the parameter that specifies the Azure service name, which in turn becomes the virtual machine name:# TODO: $NAV_AzureServiceName = 'MyService'
To set this parameter to
MyCompanyVM
, you would change the code to the following:$NAV_AzureServiceName = 'MyCompanyVM'
Note
To understand the parameters, use the help content that is provided above each parameter in the script.
When you have set all the parameters, save the file, and then proceed to the next task.
Running the Example Scripts
After you have modified the partner settings, you can run the example scripts to deploy Dynamics NAV.
To run the example script
In the Windows PowerShell ISE, open the Example-1VM.ps1 or Example-2VM.ps1 file.
The scripts are located in the Cloud\HowTo folder of the provisioning tools.
Press F5 to run the script.
It will take approximately 30-45 minutes for the script to be completed. If the script is completed without errors, then text similar to the following appears in the console:
The NAV Server machine is: MyNavVm.cloudapp.net The NAV Server machine administrator password: 123NavVm!a The NAV Server Instance is: nav_server_instance_Ins1 The NAV Server account credentials: NSTService/P@ssword312 The Windows client can be downloaded via ClickOnce at: https://MyNavVm.cloudapp.net:9004 The Web Client can be accessed at: https://MyNavVm.cloudapp.net/nav_server_instance_Ins1 A user has been added to the database with the following credentials: user=navuser password=N@Vpw312
New virtual machines appear in the Azure management portal under Virtual Machines, and you can access Dynamics NAV from the Microsoft Dynamics NAV Windows client or Microsoft Dynamics NAV Web client. For more information, see How to: Open Microsoft Dynamics NAV Clients that Connect to Microsoft Dynamics NAV on Microsoft Azure.
See Also
How to: Install the Microsoft Dynamics NAV Provisioning Tools for Microsoft Azure
Deploying and Managing Microsoft Dynamics NAV on Microsoft Azure
Deploying Microsoft Dynamics NAV on Two Virtual Machines Using Example-2VM Script
Deploying Microsoft Dynamics NAV on One Virtual Machine Using Example-1VM Script
Scaling the Microsoft Dynamics NAV Network Topology
How to: Get the Microsoft Azure Image Name