microsoft dynamics nav 2015 demo environments · microsoft dynamics nav 2015 demo environments demo...

28
Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo environments on Microsoft Azure, integrated with Office 365.

Upload: dinhdieu

Post on 15-Apr-2018

223 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Microsoft Dynamics NAV 2015 Demo Environments

Demo Environments Overview This document will explain how to create great looking demo environments on Microsoft Azure, integrated with Office 365.

Page 2: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

The Demo Environments are one-box installations, meaning that everything is installed on one box and we are using SQL Express for the demo and they come in form of a Virtual Machine Image, which is a template, based on which you can create a demo environment.

In order to create a demo environment, you will need an Azure subscription and basic knowledge about Azure and the Management Portal.

The steps you need to follow are:

1. Copy the Virtual Machine Image VHD (Template)

2. Create a Virtual Machine based on this Virtual Machine Image 3. Install the demo packages you want to use.

You can also ask your favorite Microsoft Azure hosting partner to host a demo environment for you.

Note, that this Demo Environment system is not officially supported. All PowerShell sample scripts are included on the Virtual Machines, and can be copied and/or used freely.

Freddy Kristiansen Technical Evangelist Microsoft Dynamics NAV

Microsoft Corporation

Page 3: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Copy the Virtual Machine Image VHD (Template) Virtual Machine Images in Microsoft Azure are like machine templates. Every time you get a new version of NAV, you need a new template, but the same template can be used repeatedly to create demo instances with only a few steps. You can delete Demo instances in the management portal very e asily.

The Virtual Machine Image lives in a Storage Account, which needs to be located in the region in which you need to deploy you r demo version.

Note: You need to complete this step for every Azure location in which you want to deploy Demo Environments AND for every version of NAV you want to deploy.

In this section, we are going to copy a template machine for a NAV demo machine from a public location.

There are two ways to do this.

1. Using a Web Site.

2. Using PowerShell

In both cases, Microsoft Azure will be doing to Image Copy Async. And it can take several hours to complete the Copy process. You do NOT have to have your laptop or computer running all the time.

Option 1 - Using a web site

I have created a small Web Site, which gives access to request a copy of a Virtual Machine Image VHD. The Web Site is not monitored and not officially supported and there is no guarantee that the site is up. If for some reason it doesn’t work, you can download the Visual Studio project for the WebSite or use the PowerShell way instead.

Note: You can download the source for this small web site at http://www.freddy.dk/CopyImage.zip and create your own web site – either on your local box or on Azure. The

project is can be compiled and run in Visual Studio 2013.

In the Azure Management portal (https://manage.windowsazure.com), navigate to Storage. The storage will determine the location of where you can deploy demo environments. If you do not have a Storage Account in the location you need, press NEW and create a new storage account.

Page 4: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Note down the name of your storage account and press

Manage Access Keys

In the Manage Access Keys dialog, Copy the Primary Access Key to your clipboard.

Open a browser and navigate to https://copyimage.navdemo.net Select the nearest location and the name of the Base Image you want to copy from the dropdown. If you cannot find the version you are looking for, you need to follow the instructions in the document on how to create the image yourself. Type in your Storage Account Name. Paste your Storage Account Key. Type the name of the Container in which you want to copy the image.

Page 5: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Press Copy Image and wait until the Copy completes. You do not have to keep the page open, but it helps you identify when the copy is successfully completed. Based on the locations the copy can complete instantaneously or it can take several hours.

After completion of the copy, navigate to Virtual Machines -> Images in the Azure Management Portal.

Page 6: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Press Create

Fill in Name and Description and select the uploaded

base image in the VHD URL blob picker.

Note: Sometimes it can take hours between completion

of the blob copy and the vhd appearing in the blob

picker.

Remember to check the “I have run Sysprep…”

checkbox.

Press OK

Page 7: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Option 2 - Using PowerShell

If you don’t have the Microsoft Azure Powershell module installed, then please install that from: http://azure.microsoft.com/en-us/downloads/ (click Install under Windows PowerShell)

In the Azure Management portal (https://manage.windowsazure.com), navigate to Storage. The storage will determine the location of where you can deploy demo environments. If you do not have a Storage Account in the location you need, press NEW and create a new storage account.

Page 8: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Note down the name of your storage account and

press Manage Access Keys

In the Manage Access Keys dialog, Copy the Primary Access Key to your clipboard.

Start Windows PowerShell ISE and create a new script. Paste this script into your editor. Modify the yellow values to reflect what image you want to copy and the destination storage account for the blob. $BaseUri should be set to the base Uri closest to your storage account. $Language should be set to the language of the image you want to copy. $storageaccount should be set to the storage account from the previous step. $storagekey should be set to the storage account key from the previous step.

$NEBaseUri = "https://navdemoimages.blob.core.windows.net" $WestUsBaseUri = "https://navdemoimageswestus.blob.core.windows.net" $SeAsiaBaseUri = "https://navdemoimagesseasia.blob.core.windows.net" # Location of image requested $BaseUri = $NEBaseUri # Language of image requested – options: AU,BE,CH,DE,DK,ES,FI,FR,GB,IS,IT,NA,NL,NO,NZ,RU,SE,W1 $language = "W1" # Destination $storageAccount = "<storageaccount>" $storageKey = "<storagekey>" $containerName = "vhds" # Source $ImageName = "NAV2015$language.vhd" $srcUri = "$BaseUri/vhds/$ImageName" # Storage Context $context = New-AzureStorageContext –StorageAccountName $storageAccount -StorageAccountKey $storageKey # Create Destination Container if it doesn't exist if (!(Get-AzureStorageContainer -Context $context -Name $containerName -ErrorAction SilentlyContinue)) { New-AzureStorageContainer -Context $context -Name $containerName } # Start the asynchronous copy - specify the source authentication with -SrcContext ### $blob = Start-AzureStorageBlobCopy -srcUri $srcUri ` -DestContext $context ` -DestContainer $containerName ` -DestBlob $ImageName # Retrieve the current status of the copy operation $status = $blob | Get-AzureStorageBlobCopyState

Page 9: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

$containername should be set to the name of the container name to which you want to copy the vhd The script can be aborted during the status loop without affecting the blob copy.

# Print out status $status # Loop until complete While($status.Status -eq "Pending"){ $status = $blob | Get-AzureStorageBlobCopyState Start-Sleep 10 # Print out status $status }

After completion of the copy, navigate to Virtual Machines -> Images in the Azure Management Portal.

Page 10: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Press Create

Fill in Name and Description and select the

uploaded base image in the VHD URL blob picker.

Note: Sometimes it can take hours between

completion of the blob copy and the vhd

appearing in the blob picker.

Remember to check the “I have run Sysprep…”

checkbox.

Press OK

Page 11: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Create a Virtual Machine based on this Virtual Machine Image Every time you want to setup a new demo environment based on one of your templates, you should start by following these simple steps.

The demo instance comes with a number of demo packages. You can install those after the demo instance is up running.

You can spin up as many demo environments as you like (to pay for).

If you shut down your demo environment, you will not be billed for compute hours.

Select NEW in the left bottom corner. Create a new Virtual Machine from Gallery. Select My Images and create a new Virtual Machine based on your Image.

Page 12: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Fill out Virtual Machine Name, select Size, Admin User Name and Admin Password.

Page 13: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

In the Virtual Machine Configuration, select Create a New Cloud Service, give it a unique name (preferable the same as the Virtual Machine) and select a Region. Leave the Remote Desktop and PowerShell ports untouched. Add endpoints to the list of endpoints: HTTPS, TCP 443 HTTP, TCP 80 WinClient, TCP 7046 SoapServices, TCP 7047 ODataServices, TCP 7048 HelpServer, TCP 49000 Press next, and on the next screen select Finish and wait until the Virtual Machine have been provisioned.

Now you have a basic demo environment with NAV 2015, to which you can connect with remote desktop and run NAV inside the Virtual Machine. In order to install certificates for public access, O365 integration, click-once and other things you need to install demo packages.

Page 14: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Install the demo packages you want to use The Virtual Machine comes with a number of Demo Packages that you can install.

The Demo packages are places in the folder C:\DEMO in the Virtual Machine. Demo packages available at the time of writing this document are:

1. Certificate

This package is the first package you need to install. The other packages depends on this. The package will install a SSL Certificate, either provided or created (Self

Signed) on the Virtual Machine and configure NAV for public access.

2. Extended DemoData (only for W1)

This package will replace the Demo Database on the Virtual Machine with the Extended Demodata. At this time, the extended demodata is only available for W1.

You should install the extended demodata after the Certificate package, but before other packages.

3. O365 Integration

This package will install Single Sign On with O365, create a SharePoint App, install this app in a SharePoint portal and create a Demo SharePoint Portal with NAV

embedded.

4. ClickOnce

This package will install Click-once. If you install this package after O365 integration you will get click-once with O365 authentication as well as click-once with NAV User

Password authentication.

5. Multitenancy

This package will change the service tier on the Virtual Machine to a multi -tenant server. It will also add a set of new PowerShell CmdLets for adding and removing

tenants. Clickonce is included in the multitenancy package and should NOT be installed as a separate package. Note: This package is not compatible with the Clickonce package and the O365 integration package – you will get an error if trying.

More packages will be available together with new versions of the Virtual Machine Images.

Installing Demo Packages is done by right-clicking the install <package>.ps1 file and select Run With PowerShell

Page 15: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

When running the installer, a PowerShell window will be displayed and might be asking a few questions, that the user needs to answer in orde r for the install script to complete successfully. Scripts are designed to be able to run multiple times if you discover that something went wrong, but there is no guarantee that this works.

If you discover that the Virtual Machine isn’t functional due to some installation gone wrong, delete the Virtual Machine and create a new.

The first package you need to install is the Certificate package. This package is a pre-requisite for the other packages.

Page 16: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Certificate

When applying this package to your Virtual Machine you will install a certificate (trusted or self signed) and be allowed public access to NAV. In order to avoid security warnings when connecting to your demo environment, you will have to install / trust your self signed certificate on the machine from which you are doing the demo.

In order to do this, this script will do the following:

1. SSL Certificate will be imported and the NAV Service Tier user will be granted access to the Certificate

2. An admin user will be added to NAV with a password specified by the user. This user gets SUPER permissions.

3. NAV Server is configured for SSL, config settings for GETURL are updated, authentication is changed to NavUserPassword and the Service Tier will be restarted.

4. Ports for SOAP, OData and HTTPS are opened in the Windows Firewall

5. The IIS Default WebSite will be removed (if it is there)

6. A HTTPS binding is added to the Web Client website (if it isn’t already there)

7. A HTTP bidning is removed from the Web Client website (if it is there)

8. Web.config for Web Client is modified to use NavUserPassword and the self signed certificate

9. ClientUserSettings.config for Windows Client is modified to use NavUserPassword and the self signed certificate

10. A number of shortcuts are created on the desktop

11. Help Server content is added to Windows Search Indexing Options.

12. Update the URLs.txt file on the desktop with connection info.

When running the install certificate script:

If you get a question from PowerShell on whether or not you want to change Execution Policy, Answer Yes (default)

Page 17: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

The script will ask you for the username and password for an admin user in NAV. This user will be created and assigned the SUPER permission role. The script will also ask for the name of your cloud service and the name of a trusted certificate pfx file. Note: If your Cloud Service was called something else than your Virtual Machine, then you have to enter the name of the Cloud Service here. Note: If you do not have a trusted certificate pfx file, then press ENTER and the script will create a self signed certicate.

If the script completes successfully, it will close and update a file called URLs.txt on your desktop, with information about URLs and connection info for your Demo Environment.

Page 18: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Extended DemoData When applying this package to your Virtual Machine you will get Extended Demo Data for your W1 Demo Environment.

In order to install the Extended DemoData, this script will do the following:

1. Export application objects from the existing Demo Database

2. Restore the Extended Demo Database in SQL Server

3. Remove a number of system tables from the Extended Demo Database and restore them including content from the existing Demo Database (Users, Add-ins,

Charts, Profiles, Web Services and more…)

4. Remove existing Demo Database

5. Rename Extended Demo Database to the same name as the existing Demo Database

6. Import application objects from the existing Demo Database 7. Rename company to be the same as the existing company.

When running the install Extended DemoData script, there are no questions. If the script completes successfully, it will close and you will have extended demodata.

Page 19: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

O365 Integration When applying this package to your Virtual Machine you will get O365 integration with NAV.

You need to install the certificate package before installing the O365 integration package.

In order to install the Office 365 integration, this script will do the following:

1. Create a new Web Server Instance in NAV.

2. Enable Single SignOn with Office 365 and the new instance of the NAV Web Server Instance.

3. Import a set of demo objects in NAV, for O365 portals

4. Remove X-FRAME option from web.config

5. Create a SharePoint App, that points to your NAV Demo Environment

6. If the SharePoint Portal Site already exists, then delete it.

7. Register the SharePoint App with SharePoint and upload the App to the App Catalog (Create the App Catalog if it doesn’t exist ).

8. Create SharePoint Portal Site and 3 subsites (Finance Management, Order Processing, Service Management)

9. Add content to SharePoint Portal Sites.

10. Update the URLs.txt file on the desktop with connection info.

When running the install O365 integration script:

Page 20: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Answer the eight questions (or press ENTER for default values). 1. NAV administrator user is the user you created when running the SSL+Public Access script 2. Office 365 administrator e-mail is your Office 365 login 3. The password for the above account 4. Base SharePoint URL is your SharePoint tenant, the script will calculate a default based on your Office 365 login if possible 5. SharePoint site name defaults to your machine name – use that unless you have a good reason not to – you can then have multiple demo environments connected to the same O365 account 6. If your Office 365 account was created by microsoftOfficeDemos.com or 1click, then this might be apps – else it is probably AppCatalog. If in doubt – try using one – and if it fails, run the script again and try the other one. Find the name in SharePoint by clicking Administrator -> SharePoint and locate the Site Collection for the App Catalog. 7. SharePoint Language – type in one of the language codes listed above this question (e.g. en-US) 8. TimeZone ID – find possible values in this list http://blog.jussipalo.com/2013/10/list-of-sharepoint-timezoneid-values.html

Page 21: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

The script will retry on failures a number of times. If for some reason the script keeps failing and terminates without completion – then just try to re-run the install O365 integration.ps1 and make sure that your answers to the eight questions are accurate.

If the script completes successfully, it will close and update a file called URLs.txt on your desktop, with information about URLs and connection info for your Demo Environment.

Page 22: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

ClickOnce When applying this package to your Virtual Machine you will get ClickOnce access to the Windows Client.

You need to install the certificate package before installing the ClickOnce package.

In order to install the ClickOnce, this script will do the following:

8. Create a ClickOnce manifest for the Windows Client using NAV User Password Authentication

9. If you have installed the O365 integration, create a ClickOnce manifest for the Windows Client using O365 (AAD) authentication. 10. Update the URLs.txt file on the desktop with connection info.

When running the install ClickOnce script, there are no questions. If the script completes successfully, it will close and update a file called URLs.txt on your desktop, with

information about URLs and connection info for your Demo Environment.

Page 23: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Multitenancy When applying this package to your Virtual Machine you will turn your machine into a multitenant server for demoing multi-tenancy.

You need to install the certificate package before installing the Multitenancy package.

You cannot install multitenancy after O365 or ClickOnce packages.

You need to install the Extended DemoData package before installing the Multitenancy package if you want to use

extended demo data.

In order to install the Multitenancy, this script will do the following:

1. Stop the Service Tier

2. Export the Application to an App Database

3. Remove the current database setting in the configuration file

4. Start the Service Tier (now without any database(

5. Mount the Application from the App Database

6. Mount a default tenant from the original Demo Database.

7. Change Windows and Web Client config settings to include tenant info

8. Change Desktop icons to include tenant info

9. Add Desktop shortcut to Multitenancy Demo Admin Shell 10. Backup the original demo database in as a template database for future tenants

When running the install ClickOnce script, there are no questions. If the script completes successfully, it will close and update a file called URLs.txt on your desktop, with

information about URLs and connection info for your Demo Environment.

Opening the Multitenancy Demo Admin Shell reveals a couple of new methods:

Page 24: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

New-DemoTenant [–TenantID] <string> Creates a new tenant.

Remove-DemoTenant [–TenantID] <string>

Removes a tenant

Get-DemoTenantList Displays a list of existing tenants.

Page 25: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Optional - Installing a Self Signed Certificate on your Demo Machine When demoing an environment, which has been setup with a self-signed certificate, you need to tell your demo laptop to trust the certificate you created when setting up the Demo Environment.

When connecting to a NAV Demo Environment with a Self Signed Certificate from your laptop or demo computer, you will most likely encounter this security warning.

In order to avoid this security Warning, you need to Start Internet Explorer as Administrator on your laptop/demo computer. Right click Internet Explorer and select Run as administrator.

Connect to your Demo Environment, which gave you the security warning, Continue to the Website despite IE’s warning and you will see that the address bar signals a certificate warning.

Page 26: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Click the Certificate error and validate that this indeed is because the certificate, that was presented by this website wasn’t issued by a trusted certificate authority. Now Click View certificates

If you are running Internet Explorer as Administrator, you will have the option of installing and trusting your self signed certificate. Click Install Certificate

Page 27: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Select Local Machine

Select Trusted Root Certification Authorities

Page 28: Microsoft Dynamics NAV 2015 Demo Environments · Microsoft Dynamics NAV 2015 Demo Environments Demo Environments Overview This document will explain how to create great looking demo

Click Finish. Restart Internet Explorer and your certificate warning should have disappeared.