Let NAV use TLS1.2 when talking to webservices

Lots of web service vendors these days are tightening their requirement security protocols, SSL was removed back on the hearthbleed days, and not TLS version 1.0 and 1.1 are getting outed too. So suddenly NAV code that has been working for years stop working unless you change your client to select TLS1.2. Thankfully, there is a simple trick to choose the security protocol used by DotNet. This is done with the ServicePointManager.SecurityProtocol property:

Set it to SecurityProtocol.Tls12

Now you’re talking Tls12 with DotNet from inside NAV.

Wikipedia article on TLS

 

 

How I do Docker

Image result for docker

I had quite a few conversations about Docker this past week at Directions. And in every conversation, I basically said that my Docker usage is done with one-liners. So perhaps it would be smart to list all my one-liners. So here goes:

To install Docker for Windows on my Windows 10 PC, I use Chocolatey – with this simple PowerShell command:

choco install Docker-for-Windows

Then you need to install the brilliant NavContainerHelper with another PowerShell one-liner:

install-module navcontainerhelper -force

Now we’re ready to create a Docker container. Warning: This is a one-liner, but it’s a long one, you better put it in a .ps1 file, instead of copy’paste directly to a PowerShell prompt.

New-NavContainer -accept_eula -alwaysPull -imageName "microsoft/bcsandbox:dk" -containerName bcsandbox -licenseFile 'C:\license\my2018.flf' -memoryLimit 4G -updateHosts -shortcuts Desktop -includeCSide -assignPremiumPlan -auth NavUserPassword -myScripts @{"AdditionalOutput.ps1" = 'Copy-Item -Path (Join-Path $roleTailoredClientFolder "*office*.dll") -Destination (Join-Path $serviceTierFolder "Add-ins\Office")'}

Since this is quite a long command, let me break it down into the important parameters:

accept_eula Because where’s the fun without an EndUserLicenseAgreement to accept
alwaysPull Make sure you have the latest version of the image from Microsoft.
imageName What image your container should be based on.
-containerName This is the “computer name” your container will get. This is the name you can PING, this is the name you’ll use in the browser address bar and in Visual Studio Code to access the container.
licenseFile An URL or direct file path to an FLF license file to be imported to the container.
memoryLimit Limit the memory used by the container.
updateHosts Update the hosts file with an entry for the imageName.
shortCuts Create shortcuts for access to the container.
includeCSide Because we still need CSide
assignPremiumPlan Hey, I need a Premium experience
auth NavUserPassword Create a NavUserPassword access. The first thing happening is a prompt to enter a user and password. It looks like it’s asking for you login, but the dialogue is actually asking for a user and password combo.

The last command is just something I need because some Office DLLs are missing in the add-ins folder (to be available for DotNet), you properly don’t need it unless you’re using DotNet like me:
myScripts @{“AdditionalOutput.ps1” = ‘Copy-Item -Path (Join-Path $roleTailoredClientFolder “*office*.dll”) -Destination (Join-Path $serviceTierFolder “Add-ins\Office”)’}

Speaking of DotNet, sometimes I need to add extra DotNet DLLs, that’s done with this one-liner:

Copy-FileToNavContainer -localPath c:\DLLs\*.dll -containerPath "C:\Program Files\Microsoft Dynamics NAV\130\Service\Add-ins" -containerName bcsandbox

Again a great feature of NavContainerHelper, simply copies files from my local machine into the container.

Sometimes,  I need to restart the container, also done with NavContainerHelper:

Restart-NavContainer -containerName bcsandbox

Hope this helps a bit to lean but great Docker and Business Central/NAV experience.

 

Microsoft Dynamics 365 Business Central Release

Today Microsoft Dynamics 365 Business Central has been released, both for the cloud and On-Premise.

So wait! Erik, remind me again, what’s “Business Central”?

Business Central is the new version of NAV, you could call it NAV2019, but don’t do that. The NAV name is retired, well almost. The NAV name lives on for the experience you get when you use the Windows Role Tailored Client:

And yes, just to put an end to all the mumbling, Business Central has both RTC and C/Side. Everything you have in NAV2018 is also in Business Central. That plus the new beautiful user interface in all the other clients.

More details to come, grab the docker images https://hub.docker.com/r/microsoft/bcsandbox/.