Condividi tramite


Walkthrough: Deploying Microsoft Dynamics NAV on Two Windows Azure Virtual Machines

The following walkthrough demonstrates how to use the Example-2VM.ps1 script of the Microsoft Dynamics NAV Provisioning Tools for Windows Azure to deploy Microsoft Dynamics NAV on Windows Azure. The walkthrough deploys the Microsoft Dynamics NAV components, including the CRONUS International Ltd. demonstration database, on two virtual machines as illustrated in the following figure.

NAV on 2 Azure virtual machines

When completed, you will have a new virtual machine on Windows Azure with a fully functional Microsoft Dynamics NAV environment that gives users access to Microsoft Dynamics NAV data from the Microsoft Dynamics NAV Windows client and Microsoft Dynamics NAV Web client. Additionally, the virtual machine will have full development and administration capabilities including Microsoft Dynamics NAV Development Environment, Microsoft Dynamics NAV Server Administration tool, and Microsoft Dynamics NAV Windows PowerShell cmdlets.

Icon that indicates a link to a video For a video demonstration, see How Do I: Automate Provisioning of Microsoft Dynamics NAV 2013 Across Two Windows Azure Virtual Machines.

About This Walkthrough

This walkthrough illustrates the following tasks:

  • Start Windows PowerShell ISE

  • Modifying the Set-PartnerSettings File

  • Running the Example-2VM Script

  • Opening the RoleTailored Clients

This walkthrough sets up a Microsoft Dynamics NAV environment on Windows Azure that has the following characteristics.

Item Value

Name of Azure virtual machine running Microsoft Dynamics NAV Server

MyNavServerVM

Administrator account on Azure virtual running Microsoft Dynamics NAV Server

User name: NavVmAdmin

Password: 123NavVm!a

Name of Azure virtual machine running SQL Server

MyNavSQLVM

Administrator account on Azure virtual running SQL Server

User name: NavSqlAdmin

Password: SQLP@ssword12

Dn168975.Important(en-us,NAV.70).gifImportant
If you are using a custom image to create the virtual machine, then the user name must match the administrator account user name that was specified when the custom image was created. For more information, see How to: Create a Windows Azure Virtual Machine Operating System Image for Microsoft Dynamics NAV.

Azure region

North Europe

Virtual machine size

Small

Azure virtual network

MyNavVirtualNetwork

Azure affinity group

MyNavAffinity

User authentication credential type

NavUserPassword

Microsoft Dynamics NAV Server Service account

User name: NSTService

Password: P@ssword312

Microsoft Dynamics NAV user with SUPER permissions

User name: navuser

Password: N@Vpw312

Client services port

9001

Prerequisites

To complete this walkthrough, you will need to install the prerequisites that are described in Preparing for Deploying Microsoft Dynamics NAV on Windows Azure.

The following table includes information about the prerequisites that are used to complete this walkthrough.

Item Information

PublishSettings file

C:\Users\Administrator\MyAzure-2-21-2013.publishsettings

Azure subscription name

MyAzureSubscription

Azure storage account

MyAzureStorage

Image for NAV Server virtual machine

a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201304.01-en.us-127GB.vhd

Dn168975.note(en-us,NAV.70).gifNote
This is the default image that is set in the Set-PartnerSettings.ps1 file.

Image for SQL Server virtual machine

fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Standard-CY13SU04-SQL2012-SP1-11.0.3350.0-Win2012

Dn168975.note(en-us,NAV.70).gifNote
This is the default image that is set in the Set-PartnerSettings.ps1 file.

Microsoft Dynamics NAV installation media (DVD) location

D:\NAVDVD

Microsoft Dynamics NAV database backup file location

D:\NAVDVD\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\70\Database\Demo Database NAV (7-0).bak

Microsoft Dynamics NAV license

D:\NAVDVD\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\70\Database\Cronus.flf

Microsoft Dynamics NAV provisioning tools location

C:\Cloud

Security certificate PFX file location and password for Microsoft Dynamics NAV services

Folder: C:\Cloud\Examples\HowTo\MyAzureVM.pfx

Password: pfxpassword

Security certificate PFX file and password for the Microsoft Dynamics NAV Web client

This walkthrough uses the security certificate that is automatically generated by the provisioning tools. No action is required for this prerequisite.

Security certificate PFX file location and password for ClickOnce

Folder: C:Cloud\Examples\HowTo\ClickOnceSignature.pfx

Password: clickoncesignaturepassword

Windows Azure Libraries location

C:\ProgramFiles(x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1

Microsoft Windows HTTP Services Certificate Configuration Tool

C:\ProgramFiles(x86)\Windows Resource Kits\Tools\winhttpcertcfg.exe

Manifest Generation and Editing Tool (mage.exe)

C:\ProgramFiles(x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\mage.exe

makecert.exe

C:\ProgramFiles(x86)\Windows Kits\8.0\bin\x86\makecert.exe'

Start Windows PowerShell ISE

To deploy Microsoft Dynamics NAV, you will run Windows PowerShell scripts. The procedures in this section use Windows PowerShell Integrated Scripting Environment (ISE) because it enables you to run commands, and write and debug scripts in a single graphical user interface.

Important

You must run Windows PowerShell ISE as an Administrator; otherwise the scripts will not run without errors.

To start Windows PowerShell ISE

  1. On the provisioning computer, choose Start, and then search for Windows PowerShell ISE.

  2. Right-click the Windows PowerShell ISE item, and then choose Run as Administrator.

  3. At the command prompt, change to the Cloud\Examples\HowTo folder of the provisioning tools.

    For example, enter the following code, and then press Enter:

    cd C:\Cloud\Examples\HowTo
    

Modifying the Set-PartnerSettings File

The Microsoft Dynamics NAV provisioning tools include the Set-PartnerSettings.ps1 script. The Set-PartnerSettings.ps1 script contains parameters that are used by the Example-2VM.ps1 file to configure the Microsoft Dynamics NAV deployment. In this procedure, you will create a copy of the Set-PartnerSettings.ps1 file, and then modify the copy to include the settings for your installation. You can modify Set-PartnerSetting.ps1 directly, but using a copy enables you to test different parameter values without having to change the Set-PartnerSettings.ps1 every time.

To make a copy of the Set-PartnerSettings.ps1 file

  1. In Windows PowerShell ISE, on the File menu, choose Open, and then find and open the Set-PartnerSettings.ps1 file.

    The file is located in the Cloud\Howto folder.

  2. From the File menu, choose Save As.

  3. 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-2VM.ps1 script.

    Note

    By default, the example scripts search the Cloud\Examples\HowTo folder for files that contain the text "custom", so it is important that only one custom settings file is included in the folder when you run the scripts.

To modify the Set-PartnerSettings-Custom.ps1 file

  1. In the Set-PartnerSettings-Custom.ps1 file, and locate the Windows Azure subscription settings section.

    The parameters in this section configure Windows Azure subscription settings.

  2. By default, all parameters are commented lines that are preceded by # TODO. To set a parameter, delete the # TODO, and then provide a value for the parameter.

    Start with the following line that specifies the PublishSettings file for the Windows Azure subscription:

    # TODO: $NAV_PublishSettingsFile = 'C:\users\administrator\MySubscription.PublishSettings'
    

    To set the parameter for this walkthrough, change the code to the following:

    $NAV_PublishSettingsFile = 'C:\users\administrator\MyAzure-2-21-2013.publishsettings'
    

    You change all parameters in this manner

    Tip

    For a detailed description about a parameter, see the help text that comes before the parameter in the script.

  3. Change the remaining parameters in this section as follows:

    $NAV_AzureSubscriptionName = 'MyAzureSubscription'
    $NAV_AzureStorageAccount = 'MyAzureStorage'
    
  4. Go to the Windows Azure virtual machine settings section to specify parameters for the virtual that will be created on Azure. Set the parameters as follows:

    $NAV_AzureServiceName = 'MyNavServerVm'
    $NAV_VMAdminUserName = 'NavVmAdmin'
    $NAV_VMAdminPassword = '123NavVm!a'
    $NAV_AzureLocation = 'North Europe'
    $NAV_VMSize = 'Small'
    $NAV_OSImageWithSqlServer = 'fb83b3509582419d99629ce476bcb5c8__Microsoft-SQL-Server-2012SP1-Standard-CY13SU04-SQL2012-SP1-11.0.3350.0-Win2012'
    $NAV_OSImageWithoutSqlServer = 'a699494373c04fc0bc8f2bb1389d6106__Windows-Server-2012-Datacenter-201304.01-en.us-127GB.vhd'
    
  5. Go to the 2-Box NAV Deployment settings section to specify parameters that configure the virtual machine that will run SQL Server and the Microsoft Dynamics NAV database. Set the parameters as follows:

    $NAV_SqlServerMachine = 'MyNavSQLVM'
    $NAV_SqlServerMachineAdminUserName = 'NavSqlAdmin'
    $NAV_SqlServerMachineAdminPassword = 'SQLP@ssword12'
    $NAV_AzureVirtualNetwork = 'MyNavVirtualNetwork'
    $NAV_AzureAffinityGroup = ' MyNavAffinity' 
    
  6. Go to the Microsoft Dynamics NAV installation settings section to specify parameters that install Microsoft Dynamics NAV on the virtual machine. Set the parameters as follows:

    $NAV_DvdLocation = 'D:\NAVDVD' 
    $NAV_UseAzureStorageForDvdTransfer = $true
    $NAV_DvdVhdName = "$NAV_AzureServiceName-DynamicsNAVDvd.vhd"
    $NAV_BakFile = 'D:\NAVDVD\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\70\Database\Demo Database NAV (7-0).bak'
    $NAV_DatabaseDiskSizeInGB = 10
    $NAV_RemoteDatabaseBackupFile = 'C:\REMOTE\navdvd\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\70\Database\Demo Database NAV (7-0).bak'
    
  7. Go to the Microsoft Dynamics NAV Instance settings section to specify parameters for that configure Microsoft Dynamics NAV Server. Set the parameters as follows:

    $NAV_InstanceName = 'DynamicsNAV70_Instance1'
    $NAV_InstanceNameInternal = 'Inst1'
    $NAV_ManagementServicesPort = 9000
    $NAV_ClientServicesPort = 9001
    $NAV_ClickOnceWebSitePort = 9004
    $NAV_WindowsServiceAccount = 'NSTService'
    $NAV_WindowsServiceAccountPassword = 'P@ssword312'
    $NAV_NAVAdminUserName = 'navadmin'
    $NAV_NAVAdminPassword = 'N@Vpw312'
    $NAV_LicenseFile = 'D:\NAVDVD\SQLDemoDatabase\CommonAppData\Microsoft\Microsoft Dynamics NAV\70\Database\Cronus.flf'
    $NAV_NewCompanyName = 'MyCompany
    
  8. Go to the Security Certificates for NAV Client Services settings section to specify parameters that configure security certificates for the clients and ClickOnce installation of the Microsoft Dynamics NAV Windows client. Set the parameters as follows:

    $NAV_ClientServicesPfxFile = 'C:\Cloud\Examples\HowTo\MyAzureVM.pfx'
    $NAV_HttpsWebClientPfxFile = ""
    $NAV_HttpsWebClientPfxPassword = ""
    $NAV_ClientServicesPfxPassword = "pfxpassword"
    $NAV_ClickOnceCodeSigningPfxFile = 'C:\Cloud\Examples\HowTo\ClickOnceSignature.pfx' 
    $NAV_ClickOnceCodeSigningPfxPassword = 'clickoncesignaturepassword'
    
  9. Go to the Tool dependencies section to specify parameters that are required for the deployment.

    $Global:AzurePowershellModuleFile = Join-Path ${env:ProgramFiles(x86)} 'Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1'
    $Global:MageExeFile = Join-Path ${env:ProgramFiles(x86)} 'Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\mage.exe'
    $Global:WinHttpCertCfgExeFile = Join-Path ${env:ProgramFiles(x86)} 'Windows Resource Kits\Tools\winhttpcertcfg.exe'
    $Global:MakeCertExeFile = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits\8.0\bin\x86\makecert.exe'
    
  10. Save the file.

    You are ready to run the script.

Running the Example-2VM Script

After you have set the parameters in the Set-PartnerSettings-Custom.ps1 file, you can run the script to create the virtual machine on Windows Azure and deploy Microsoft Dynamics NAV.

To run the example script

  1. In the Windows PowerShell ISE, open the Example_2VM.ps1

    The script is located in the Cloud\HowTo directory.

  2. Press F5 to run the script.

    It will take approximately 30-45 minutes for the script to finish. 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: DynamicsNAV70_Ins1
    The NAV Server account credentials: NSTService/P@ssword312
    The SQL Server machine is: NavSqlAdmin.cloudapp.net
    The SQL Server machine administrator password: SQLP@ssword12
    The Windows Client can be downloaded via ClickOnce at: http://MyNavVm.cloudapp.net:9004
    The Web Client can be accessed at: https://MyNavVm.cloudapp.net/DynamicsNAV70_Ins1
    A user has been added to the database with the following credentials:
      user=navuser
      password=N@Vpw312
    

    Two new virtual machines are added on Windows Azure. To see the new virtual machine, sign in to the Windows Azure Management Portal, and then choose VIRTUAL MACHINES.

Opening the RoleTailored Clients

When the script has completed without errors, you can then access the RoleTailored clients.

To open the Microsoft Dynamics NAV Windows client

  1. Open an Internet browser.

  2. In the address, type the following address:

    http://MyNavVm.cloudapp.net:9004

  3. Follow the instructions on the webpage to install the Microsoft Dynamics NAV Windows client.

To open the Microsoft Dynamics NAV Web client

  1. Open an Internet browser.

  2. In the address, type the following address:

    https://MyNavVm.cloudapp.net/DynamicsNAV70\_Instance1

Next Steps

Scaling the Microsoft Dynamics NAV Network Topology on Windows Azure

Security and Protection for Microsoft Dynamics NAV 2013 on Windows Azure

How to: Configure SOAP and OData Web Services for Microsoft Dynamics NAV on Windows Azure

See Also

Tasks

Walkthrough: Deploying Microsoft Dynamics NAV on a Windows Azure Virtual Machine

Concepts

Planning and Preparing for Deploying on Windows Azure
Deploying and Managing Microsoft Dynamics NAV on Windows Azure
Deploying Microsoft Dynamics NAV on Two Virtual Machines Using Example-2VM Script