zoukankan      html  css  js  c++  java
  • Deploy D365 on Azure with PowerShell

    The following walkthrough demonstrates how to use the Example-1VM.ps1 script of the Microsoft Dynamics NAV Provisioning Tools for Microsoft Azure to deploy Dynamics NAV on Microsoft Azure from a local computer. The walkthrough deploys the Dynamics NAV components, including the CRONUS International Ltd. demonstration database, on a single virtual machine as illustrated in the following figure.

    Network topology for Example-1VM script

    When completed, you will have a new virtual machine on Azure with a fully functional Dynamics NAV environment that gives users access to Dynamics NAV data from the Microsoft Dynamics NAV Windows client and Microsoft Dynamics NAV Web client.

    About This Walkthrough

    This walkthrough illustrates the following tasks:

    1. Start Windows PowerShell ISE

    2. Modifying the Set-PartnerSettings File

    3. Running the Example-1VM Script

    4. Opening the Microsoft Dynamics NAV Clients

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

    About This Walkthrough
    ItemValue
    Azure virtual machine name MyNavVM
    Domain name .cloudapp.net

    This value is combined with the Azure virtual machine name so that the fully qualified domain name of the virtual machine becomes MyNAVVM.cloudapp.net.
    Administrator account on Azure virtual name User name: NavVmAdmin

    Password: This walkthrough uses an automatically generated password. Important: 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 Microsoft Azure Virtual Machine Operating System Image for Microsoft Dynamics NAV.
    Azure region North Europe
    Virtual machine size Small
    User authentication credential type NavUserPassword
    Service account for Microsoft Dynamics NAV Server User name: NSTService

    Password: This walkthrough uses an automatically generated password.
    Dynamics NAV user with SUPER permissions User name: navuser

    Password: This walkthrough uses an automatically generated password.
    Client services port 9001
    SOAP services port 9002
    OData services port 9003
    ClickOnce website port 9004
    Dynamics NAV company name MyCompany

    This walkthrough restores data for the CRONUS International Ltd. company from a Dynamics NAV database backup file, and then renames the company to MyCompany.
    Language setting on the Dynamics NAV Web Server en-US
    Region format setting on the Dynamics NAV Web Server en-US

    Prerequisites

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

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

    Prerequisites
    ItemInformation
    PublishSettings file C:UsersAdministratorMyAzure-2-21-2013.publishsettings
    Azure subscription name MyAzureSubscription
    Azure storage account MyAzureStorage
    Image for virtual machine This walkthrough will use the latest version of a supported image from the Azure Image Gallery. You do not have to do anything to meet this prerequisite.
    Dynamics NAV installation media (DVD) location D:NAVDVD
    Dynamics NAV database backup file location D:NAVDVDSQLDemoDatabaseCommonAppDataMicrosoftMicrosoft Dynamics NAV72DatabaseDemo Database NAV (7-2).bak
    Dynamics NAV license D:NAVDVDSQLDemoDatabaseCommonAppDataMicrosoftMicrosoft Dynamics NAV72DatabaseCronus.flf
    Microsoft Dynamics NAV Provisioning Tools for Microsoft Azure location. C:Cloud

    The Microsoft Dynamics NAV Provisioning Tools for Microsoft Azure are included in the WindowsPowerShellScriptsCloud folder on Dynamics NAV installation media. For this walkthrough, you copy the Cloud folder and its content to the C: drive. The Example-1VM.ps1 script and Set-PartnerSettings file that are used in the walkthrough are in the CloudHowTo folder.
       
    Security certificate PFX file location and password for Dynamics NAV client services File: C:CloudHowToMyAzureVM.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 File: C:CloudHowToClickOnceSignature.pfx

    Password: clickoncesignaturepassword
    Azure Libraries location C:ProgramFiles(x86)Microsoft SDKsMicrosoft AzurePowerShellAzureAzure.psd1
    Microsoft Windows HTTP Services Certificate Configuration Tool C:ProgramFiles(x86)Windows Resource KitsToolswinhttpcertcfg.exe
    Manifest Generation and Editing Tool (mage.exe) C:ProgramFiles(x86)Microsoft SDKsWindowsv8.0AinNETFX 4.0 Toolsmage.exe
    makecert.exe C:ProgramFiles(x86)Windows Kits8.0inx86makecert.exe

    Start Windows PowerShell ISE

    To deploy 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 Windows PowerShell ScriptsCloudHowTo folder of the provisioning tools.

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

       
    1. cd C:CloudHowTo  
      

    Modifying the Set-PartnerSettings File

    The Microsoft Dynamics NAV Provisioning Tools for Microsoft Azure include the Set-PartnerSettings.ps1 script. The Set-PartnerSettings.ps1 script contains parameters that are used by the Example-1VM.ps1 file to configure the 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 could modify Set-PartnerSetting.ps1 directly, but using a copy enables you to test different parameter values without having to change 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 CloudHowto folder.

    2. On the File menu, choose Save As.

    3. Save the file in the same folder as Set-PartnerSettings.ps1 and give it the name Set-PartnerSettings-CUSTOM.ps1.

      Because you save this file in the same folder as Set-PartnerSettings.ps1, the Set-PartnerSettings-CUSTOM.ps1 file is automatically loaded by the Example_1VM.ps1 script.

      Note

      By default, the example scripts search the CloudHowTo 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.

    To modify the Set-PartnerSettings-Custom.ps1 file

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

      The parameters in this section configure Microsoft 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.

      Go to the following line of code that specifies the PublishSettings file for the Microsoft Azure subscription:

       
    # TODO: $NAV_PublishSettingsFile = 'C:usersadministratorMySubscription.PublishSettings'  
    

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

     
    • $NAV_PublishSettingsFile = 'C:usersadministratorMyAzure-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.

    • Change the remaining parameters in this section as follows:

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

       
    • $NAV_AzureServiceName = 'MyNavVm'  
      $NAV_DomainName = 'cloudapp.net'  
      $NAV_VMAdminUserName = 'NavVmAdmin'  
      $NAV_VMAdminPassword = ''  
      $NAV_AzureLocation = 'North Europe'  
      $NAV_VMSize = 'Small'  
      $NAV_OSImageWithSqlServer = ''  
      

      Because you do not provide a value for the $NAV_VMAdminPassword setting, the script will generate a password automatically. You will see the password in the message that appears when the script has completed.

      Because you do not provide a value for the $NAV_OSImageWithSqlServer setting, the script will use the latest version of a supported image from the Azure Gallery.

    • Go to the Microsoft Dynamics NAV installation settings section to specify parameters that install 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:NAVDVDSQLDemoDatabaseCommonAppDataMicrosoftMicrosoft Dynamics NAV72DatabaseDemo Database NAV (7-2).bak'  
      $NAV_DatabaseDiskSizeInGB = 10  
      $NAV_RemoteDatabaseBackupFile = 'C:REMOTE
      avdvdSQLDemoDatabaseCommonAppDataMicrosoftMicrosoft Dynamics NAV72DatabaseDemo Database NAV (7-2).bak'  
      
    • Go to the Microsoft Dynamics NAV Instance settings section to specify parameters that configure Microsoft Dynamics NAV Server. Set the parameters as follows:

       
    • $NAV_InstanceName = 'DynamicsNAV72_Instance1'  
      $NAV_InstanceNameInternal = 'Inst1'  
      $NAV_ManagementServicesPort = 9000  
      $NAV_ClientServicesPort = 9001$  
      $NAV_SOAPServicesPort = 9002  
      $NAV_ODataServicesPort = 9003  
      $NAV_ClickOnceWebSitePort = 9004  
      $NAV_WindowsServiceAccount = 'NSTService'  
      $NAV_WindowsServiceAccountPassword = ''  
      $NAV_NAVAdminUserName = 'navadmin'  
      $NAV_NAVAdminPassword = ''  
      $NAV_LicenseFile = 'D:NAVDVDSQLDemoDatabaseCommonAppDataMicrosoftMicrosoft Dynamics NAV72DatabaseCronus.flf'  
      $NAV_ExistingCompanyFromBackup = 'CRONUS International Ltd.'  
      $NAV_NewCompanyName = 'MyCompany'  
      $NAV_WebServerLanguage = 'en-US'  
      $NAV_WebServerRegionFormat = 'en-US'  
      

      Because you do not provide a values for the $NAV_WindowsServiceAccountPassword and $NAV_NAVAdminPasswordsettings, the script will generate passwords automatically. You will see the passwords in the message that appears when the script has completed.

    • 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:CloudHowToMyAzureVM.pfx'  
      $NAV_ClientServicesPfxPassword = "pfxpassword"  
      $NAV_HttpsWebClientPfxFile = ""  
      $NAV_HttpsWebClientPfxPassword = ""  
      $NAV_ClickOnceCodeSigningPfxFile = 'C:CloudHowToClickOnceSignature.pfx'   
      $NAV_ClickOnceCodeSigningPfxPassword = 'clickoncesignaturepassword'  
      
    • Go to the Tool dependencies section to specify parameters for the tools for the deployment.

       
    1. $Global:AzurePowershellModuleFile = Join-Path ${env:ProgramFiles(x86)} 'Microsoft SDKsMicrosoft AzurePowerShellAzureAzure.psd1'  
      $Global:MageExeFile = Join-Path ${env:ProgramFiles(x86)} 'Microsoft SDKsWindowsv8.0AinNETFX 4.0 Toolsmage.exe'  
      $Global:WinHttpCertCfgExeFile = Join-Path ${env:ProgramFiles(x86)} 'Windows Resource KitsToolswinhttpcertcfg.exe'  
      $Global:MakeCertExeFile = Join-Path ${env:ProgramFiles(x86)} 'Windows Kits8.0inx86makecert.exe'  
      
      
    2. Save the file.

      You are ready to run the script.

    Running the Example-1VM 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 Azure and deploy Dynamics NAV.

    To run the example script

    1. In the Windows PowerShell ISE, open Example-1VM.ps1

      The script is located in the CloudHowTo 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.

       
    1. The NAV Server virtual machine is: MyNavVm.cloudapp.net   
      The NAV Server virtual machine administrator username: NSTService  
      The NAV Server virtual machine administrator password: [password]  
      The NAV Server Instance is: DynamicsNAV72_Ins1  
      The NAV Server account credentials: NSTService/[password]  
      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/DynamicsNAV72_Ins1  
      A user has been added to the database with the following credentials:  
        user=navuser  
        password=[password]  
      

      A new virtual machine is added on Azure. To see the new virtual machine, sign in to the Microsoft Azure Management Portal, and then choose VIRTUAL MACHINES.

    Opening the Microsoft Dynamics NAV 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:

      https://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/DynamicsNAV72_Instance1

  • 相关阅读:
    Oracle 正则表达式函数-REGEXP_SUBSTR 使用例子
    Oracle 正则表达式函数-REGEXP_INSTR 使用例子
    Oracle 正则表达式函数-REGEXP_LIKE 使用例子
    Oracle 正则表达式函数-REGEXP_REPLACE 使用例子
    依赖注入和控制反转的理解
    Kindle 推送教程:教你用电子邮箱推送电子书(Kindle伴侣)
    gradle基础的build文件模板_jetty
    SSO
    ElasticSearch1.7 java api
    Ubuntu mysql
  • 原文地址:https://www.cnblogs.com/lingdanglfw/p/14775732.html
Copyright © 2011-2022 走看看