Scope

I think all of you already know what is Microsoft Flow. If not, you can get a quick overview here . 

All of this looks very simple, but if it really so?  

Yes.... but, before you will make simple flows in Microsoft flow service, you should connect your current apps.

In a current blog, I will describe how to connect Dynamics NAV 2017, which works on Azure VM.

NAV Server 

First, we should configure OData tab in NAV Server. 

To work with MS Flow, setups should be:

Field Value
Enable add in annotations Yes
Enable OData Services Yes
Enable SSL Depends on client services. If your client is https then OData will be HTTP. Suggest to use No setup
Enable V3 Endpoint Yes
Enable V4 Endpoint Yes
OData URL http://[VMNAME].cloudapp.azure.com:[ODATA PORT]/[NAVSERVER]/OData/
Port ODATA PORT

Important!

    • OData URL should not be a localhost, it should be equal to Azure VM DNS name (see below).
    • Remember OData Port, we should use it later in setup of Azure VM (see below)
    • Don't forget to run NAV Server :)

NAV Setup

Create user


    • User Name will be used in MS Flow Connection User Name field
    • Web Service Access Key. Create this key by click on Assist button. It will be used in MS Flow Connection User Password field

Create Web Service



Here you should add your tables (Object type = Page) to which you will make a connection from MS Flow. 

F. ex. if you want to send notifications to your customers, when sales order will be shipped, you need to publish

    • Sales Order - to check if it was modified
    • Contact - to get e-mail of customer

Don't forget to publish your web service!

Azure VM

DNS

Your virtual machine should have dns name. This is short video how to setup it

Create Inbound security rules

Add inbound security rule for OData Port. Check here how to setup it. 

If you will not open OData port on your VM, your OData services will not be accessed.

Check!

You can check how your OData service works by using such services as http://services.odata.org/validation/ 

Microsoft Flow Connection

What are MS Flow connections and how to setup them, you can find here .

To connect Dynamics NAV, you should choose it in connections and setup as on next screen.

    • OData feed URL should be equal to NAV Server OData URL
    • Username should be equal to NAV Username 
    • Password should be equal to NAV User Web Service Access Key
    • Company should be equal to NAV Company 

Demo

I've prepared also video tutorial How to send notifications to customers when sales order is Released.

(Sorry for Russian language in this video, I will translate it later, when find some time)

Update (Jan 18)

If you use NAV on Docker container, then by default URL is secured (https), but certificate is self-signed. So, Flow will not work. You should create new NAV container with parameter -useSSL:$false

See tweeter issue here