Enterprise Ready Jupyter Hub on the Linux Data Science VM

Hi everyone, this time we want to try to improve the data science experience of the Azure Linux Data Science VM with a special focus on accounts and authentication.

Data Scientists , as all the employees in major Enterprises, have an active directory account, the one they use everyday to logon on their laptops and to access emails. When instead they have to use Data science exploration tools like Jupyter notebooks they have to remember specific local accounts created for this objective (using notebooks) and of course the IT managing these accounts it’s even loaded of procedures and checks to manage these additional accounts in addition to the usual ones on Active Directory.

We will try to improve this experience explaining how to set up a Linux Data Science VM joined to a managed domain and have also Jupyter Hub authentication working with the very same domain.

The things to set up are the following:

  1. An Azure Active Directory that usually mirrors automatically the on-premise active directory structure and content
  2. Azure Active Directory Domain Services with its own Classic VNET
  3. Another Resource Manager VNET where one or more Linux DS VMs will be deployed
  4. A peering between the two VNETs
  5. The packages needed for the Linux OS to join a managed domain
  6. The authentication module for Jupyter Hub that makes authentication happen against the managed domain

Why all these components and complexity?

Well Azure Active Directory works mainly with oauth protocol while OS authentication works with Kerberos tickets that requires an “old fashion” managed domain and Domain Services it’s a way to have this completely managed by Azure. In addition Domain Services gives us also LDAP protocol support that is exactly what we need for Jupyter Hub.

The two VNETs are needed because Domain Services still needs a “Classic VNET” while the modern Linux DS VMs are made with Resource Manager template. The peering between the two guarantees that they can see each other even if they are separate.


Now we will demonstrate step by step how to setup all the necessary components.

Step N. 1 Create an Azure Active Directory

Go to https://manage.windowsazure.com/ and here click on +New button on the left hand bottom corner, go and click on App Services > Active Directory > Directory, finally click on Custom Create , here choose name, domain name and Country .

Pay attention to country choice because it will decide on which datacenter your active directory will be.

Once done you should have something like mytestdomain.onmicrosoft.com .

Step N. 2 Create Azure Active Directory Domain Services with its own Classic VNET

Here simply follow this great Microsoft step by step tutorial   completing all the 5 tasks. Do not forget , if you do not import from on premise AD, to add at least one user , to change the password of this user and to add it to AAD DC Administrators group.

Step N.3 Create a Resource Manager based VNET

Here simply go to the new portal.azure.com and create a normal vnet paying attention to choose the addresses in way that are not overlapping with the ones of the previous VNET (so if you have choosen for the classic VNET , pick for the new one).

Step N.4 Define the peering between the two VNETs

Go to portal.azure.com, to the new VNET that you have just created and enable the peering :


Step N.5 Deploy  and Configure Linux DS VM

Again from portal.azure.com , add a new Linux Data Science VM CentOS version and during the configuration pay attention to pick as VNET the latest one you created (the ARM based one).

Once the VM is up install the needed packages with this command:

yum install sssd realmd oddjob oddjob-mkhomedir adcli samba-common samba-common-tools krb5-workstation openldap-clients policycoreutils-python -y

Go now to /etc/resolv.conf and setup the name resolution in the putting the domain name and the ipaddress of the azure domain services (one of the two).

Here an example:

search mytestdomain.onmicrosoft.com

Now join the domain with this command (change the user to the admin defined at Step 2)

realm join –user=administrator mytestdomain.onmicrosoft.com

Check that everything is ok with the command realm list .

Now modify the /etc/sssd/sssd.conf changing these two lines in the following way:

use_fully_qualified_names = False
fallback_homedir = /home/%u

and restart the sssd demon with this command systemctl restart sssd .

Now try to login/ssh with simple domain username (without @mytestdomain.onmicrosoft.com) and password and everything should work.

Step 6 Configure Jupiter Hub

Add the ldap connector with pip:

pip install jupyterhub-ldapauthenticator

Configure the jupyter hub configuration file in the following way (change Ip Address and other parameters accordingly):

c.JupyterHub.authenticator_class = ‘ldapauthenticator.LDAPAuthenticator’
c.LDAPAuthenticator.server_address = ‘’
c.LDAPAuthenticator.bind_dn_template = ‘CN={username},OU=AADDC Users,DC=mytestdomain,DC=onmicrosoft,DC=com’
c.LDAPAuthenticator.lookup_dn = True
c.LDAPAuthenticator.user_search_base = ‘DC=mytestdomain,DC=onmicrosoft,DC=com’
c.LDAPAuthenticator.user_attribute = ‘sAMAccountName’
c.LDAPAuthenticator.server_port = 389
c.LDAPAuthenticator.use_ssl = False
c.Spawner.cmd = [‘/anaconda/envs/py35/bin/jupyterhub-singleuser’]

Now to troubleshoot and verify that everything works kill the jupyterhub processes running by default on the linux DS VM and try the following command (sudo is needed to launch jupyter hub in multiuser mode):

sudo /anaconda/envs/py35/bin/jupyterhub -f /path/toconfigfile/jupyterhub_config.py –no-ssl –log-level=DEBUG

Now try to authenticate going to localhost:8000 with domain username (without @mytestdomain.onmicrosoft.com) and password and you should be able to log on on juypter with your AAD credentials.



Image recognition for everyone

Warning : I’m NOT a data scientist, but I huge fan of cool technology !

Today I want to write of a new functionality that amazes me and that can help you to literally do “magic” things that you can think can be exclusive of super data scientists expert of deep learning and frameworks like TensorFlow, CNTK, Caffe,etc…

Imagine the following: someone  trains huge neural networks (imagine like mini brains) for weeks/months using a lot of GPUs on thousands and thousands of images.

These mini brains are then used to classify images and say something like: a car is present, a human is present, a cat etc… . Now one of “bad things” of neural networks is that usually you cannot understand how they really work internally and what is the “thinking process” of a neural network.


However latest studies on neural networks have found a way to “extract” this knowledge and Microsoft has delivered right now in April this knowledge or better these models.

Now I want to show you an example on how to do this.

Let’s grab some images of the Simpsons :


and some other images of the Flintstones:


For example 13 images of Simpson cartoon and 11 of Flintstones. And let’s build a program that can predict given a new image that is not part of the two image sets if it is a Simpson or Flintstone image. I’ve chosen cartoons but you can apply this to any image that you want to process (watches? consoles? vacation places? etc…).

The idea is the following: I take the images I have and give these images to the “model” that has been trained . Now the result of this process will be , for each image, a collection of “numbers” that are the representation of that image according to the neural network. An example to understand that: our DNA is a small fraction of ourselves but it can “represent” us, so these “numbers” are the DNA of the image.

Now that we have the image represented by a simple array of numbers, we can use a “normal” machine learning technique like linear regression to leverage this simplified representation of the image and learn how to classify them.

Applying the sample R code described in the article to only a small sample of images (13 and 11 respectively) using 80% for training and 20% for scoring we obtained the following result:


A good 75% on a very small amount of images !



Pyspark safely on Data Lake Store and Azure Storage Blob

Hi , I’m working on several projects where is required to access cloud storages (in this case Azure Data Lake Store and Azure Blob Storage) from pyspark running on Jupyter avoiding that all the Jupyter users are accessing these storages with the same credentials stored inside the core-site.xml configuration file of the Spark Cluster.



I started my investigations looking at the SparkSession that comes with Spark 2.0, especially to commands like this spark.conf.set(“spark.sql.shuffle.partitions”, 6), but I discovered that this command are not working at Hadoop settings level, but they are limited to the spark runtime parameters.

I moved then my attention to SparkContext and in particular to HadoopConfiguration that seemed promising but it is missing into the pyspark implementation…

Finally I was able to find this excellent Stackoverflow post that points out how to leverage the HadoopConfiguration functionality from pyspark.

So in a nutshell you can have the core-site.xml defined as follows:


So as you can see we do not store any credential here.

Let’s see how to access Azure Storage Blob Container with a shared access signature that can be created specifically to access a specific Container (imagine it like a folder) and set almost a fine grained security model on the  Azure Storage account without sharing the Azure Blob Storage Access Keys.

If you love python here some code that an admin can use to generate SAS signatures quickly that last for 24 hours:

from azure.storage.blob import (

from datetime import datetime, timedelta

account_name ="ACCOUNT_NAME"
account_key ="ADMIN_KEY"

block_blob_service = BlockBlobService(account_name=account_name, account_key=account_key)

sas_url = block_blob_service.generate_container_shared_access_signature(CONTAINER_NAME,ContainerPermissions.READ,datetime.utcnow() + timedelta(hours=24),)


You will obtain something like this:


You can refer to this link to understand the structure.

Ok now, once the azure storage admin provide us the signature, we can use this SAS signature to access directly the files on the Azure Storage Blob Container safely:

 sc._jsc.hadoopConfiguration().set("fs.azure.sas.PUT_YOUR_CONTAINER_NAME.PUT_YOUR_ACCOUNT_NAME.blob.core.windows.net", "PUT_YOUR_SIGNATURE")
 from pyspark.sql.types import *

# Load the data.We use the sample HVAC.csv file of HDInsight samples
 hvacText = sc.textFile("wasbs://PUT_YOUR_CONTAINER_NAME@PUT_YOUR_ACCOUNT_NAME.blob.core.windows.net/HVAC.csv")

# Create the schema
 hvacSchema = StructType([StructField("date", StringType(), False),StructField("time", StringType(), False),StructField("targettemp", IntegerType(), False),StructField("actualtemp", IntegerType(), False),StructField("buildingID", StringType(), False)])

# Parse the data in hvacText
 hvac = hvacText.map(lambda s: s.split(",")).filter(lambda s: s[0] != "Date").map(lambda s:(str(s[0]), str(s[1]), int(s[2]), int(s[3]), str(s[6]) ))

# Create a data frame
 hvacdf = sqlContext.createDataFrame(hvac,hvacSchema)

# Register the data fram as a table to run queries against
 from pyspark.sql import HiveContext
 hive_context = HiveContext(sc)
 bank = hive_context.table("hvac")

The same idea can be applied to data lake store. Assuming that you have your data lake credentials setup as described here , you can access data lake store safely in this way:

sc._jsc.hadoopConfiguration().set("dfs.adls.oauth2.refresh.url", "https://login.microsoftonline.com/PUT_YOUR_TENANT_ID/oauth2/token")
sc._jsc.hadoopConfiguration().set("dfs.adls.oauth2.client.id", "PUT_YOUR_CLIENT_ID")
sc._jsc.hadoopConfiguration().set("dfs.adls.oauth2.credential", "PUT_YOUR_SECRET")

  from pyspark.sql.types import *

# Load the data. The path below assumes Data Lake Store is default storage for the Spark cluster
  hvacText = sc.textFile("adl://YOURDATALAKEACCOUNT.azuredatalakestore.net/Samples/Data/HVAC.csv")

# Create the schema
  hvacSchema = StructType([StructField("date", StringType(), False),StructField("time", StringType(), False),StructField("targettemp", IntegerType(), False),StructField("actualtemp", IntegerType(), False),StructField("buildingID", StringType(), False)])

  # Parse the data in hvacText
  hvac = hvacText.map(lambda s: s.split(",")).filter(lambda s: s[0] != "Date").map(lambda s:(str(s[0]), str(s[1]), int(s[2]), int(s[3]), str(s[6]) ))

  # Create a data frame
  hvacdf = sqlContext.createDataFrame(hvac,hvacSchema)

  # Register the data fram as a table to run queries against

    from pyspark.sql import HiveContext
hive_context = HiveContext(sc)
bank = hive_context.table("hvac")

Happy coding with pyspark and Azure!

Data scientists wanna have fun!

Hi everyone, yes I’m back!

This is time we are going to setup a Big Data playground on Azure that can be really useful for any python/pyspark data scientist .

Typically what you can have out of the box on Azure for this task it’s Spark HDInsight cluster (i.e. Hadoop on Azure in Platform as a Service mode) connected to Azure Blob Storage (where the data is stored)  running pyspark jupyter notebooks.

It’s a fully managed cluster that you can start in few clicks and gives you all the Big Data power you need to crunch billions of rows of data, this means that cluster nodes configuration, libraries, networking, etc.. everything is done automatically for you and you have just to think to solve your business problems without worry about IT tasks like “check if cluster is alive or check if cluster is ok, etc…”  , Microsoft will do this for you.

Now one key ask that data scientist have is : “freedom!” , in other words they want to install/update new libraries , try new open source packages but at the same time they also don’t want to manage “a cluster” as an IT department .

In order to satisfy these two requirements we need some extra pieces in our playground and one key component is the Azure Linux Data Science Virtual Machine.

The Linux Data Science Virtual Machine it’s the Swiss knife for all data science needs, here  you can have an idea of all the incredible tasks you can accomplish with this product .

In this case I’m really interested in these capabilities:

  • It’s a VM so data scientists can add/update all the libraries they need
  • Jupyter and Spark are already installed on it so data scientists can use it to play locally and experiment on small data before going “Chuck Norris mode” on HDInsight

But there is something missing here…., as a data scientist I would love to work in one unified environment accessing all my data and switch with a simple click from local to “cluster” mode without changing anything in my code or my configurations.

Uhmmm…. seems impossible, here some magic is needed !

Wait a minute , did you say “magic”? I think we have that kind of magic :-), it’s spark magic!

In fact we can use the local jupyter and spark environment by default and when we need the power of the cluster using spark magic when can , simply changing the kernel of the notebook,  run the same code on the cluster!

diagramIn order to complete the setup we need to do the following:

  1. Add to the Linux DS VM the possibility to connect , via local spark, to azure blob storage (adding libraries, conf files and settings)
  2. Add to the Linux DS VM spark magic (adding libraries, conf files and settings) to connect from local Jupyter notebook to the HDInsight cluster using Livy

Here the detailed instructions:

Step 1  to start using Azure blob from your Spark program (ensure you run these commands as root):

cd $SPARK_HOME/conf
cp spark-defaults.conf.template spark-defaults.conf
cat >> spark-defaults.conf <<EOF
spark.jars                 /dsvm/tools/spark/current/jars/azure-storage-4.4.0.jar,/dsvm/tools/spark/current/jars/hadoop-azure-2.7.3.jar

If you dont have a core-site.xml in $SPARK_HOME/conf directory run the following:

cat >> core-site.xml <<EOF
< ?xml version=”1.0″ encoding=”UTF-8″?>
< ?xml-stylesheet type=”text/xsl” href=”configuration.xsl”?>
< configuration>
< property>
< /property>
< property>
< /property>
< /configuration>

Else, just copy paste the two <property> sections above to your core-site.xml file. Replace the actual name of your Azure storage account and Storage account key.

Once you do these steps, you should be able to access the blob from your Spark program with the wasb://YourContainer@YOURSTORAGEACCOUNT.blob.core.windows.net/YourBlob URL in the read API.

Step 2 Enable local Juypiter notebook with remote spark execution on  HDInsight (Assuming that default python is 3.5 like is coming from Linux DS VM ):

sudo /anaconda/envs/py35/bin/pip install sparkmagic

cd /anaconda/envs/py35/lib/python3.5/site-packages

sudo /anaconda/envs/py35/bin/jupyter-kernelspec install sparkmagic/kernels/pyspark3kernel

sudo /anaconda/envs/py35/bin/jupyter-kernelspec install sparkmagic/kernels/sparkkernel

sudo /anaconda/envs/py35/bin/jupyter-kernelspec install sparkmagic/kernels/sparkrkernel


in your /home/{YourLinuxUsername}/ folder

  1. create a folder called .sparkmagic and create a file called config.json
  2. Write in the file the configuration values of HDInsight (livy endpoints and auth) as described here :

At this point going back to Jupyter should allow you run your notebook against the HDInsight cluster using PySpark3, Spark, SparkR kernels and you can switch from local Kernel to remote kernel execution with one click!

Of course some security features have to improved (passwords in clear text!), but the community is already working on this (see here support for base64 encoding) and ,of course , you can get the spark magic code from git, add the encryption support you need and bring back this to the community!

Have fun with Spark and Spark Magic!

UPDATE : here instructions on how to connect also to Azure Data Lake Store!

  1. Download this package and just extract these two libraries: azure-data-lake-store-sdk-2.0.11.jar , hadoop-azure-datalake-3.0.0-alpha2.jar
  2. Copy these libraries here “/home/{YourLinuxUsername}/Desktop/DSVM tools/spark/spark-2.0.2/jars/”
  3. Add their path to the list of library paths inside spark-defaults.conf as we have done before
  4. Go here and after you have created your AAD Application note down : Client ID, Client Secret and Tenant ID
  5. Add the following properties to your core-site.xml replacing the values with the ones you have obtained from the previous step:<property><name>dfs.adls.oauth2.access.token.provider.type</name><value>ClientCredential</value></property><property><name>dfs.adls.oauth2.refresh.url</name><value> https://login.microsoftonline.com/{YOUR TENANT ID}/oauth2/token</value></property><property><name>dfs.adls.oauth2.client.id</name><value>{YOUR CLIENT ID}</value></property>

    <property><name>dfs.adls.oauth2.credential</name><value>{YOUR SECRET ID}</value></property>



E2E Product Info Bot Demo

Hi this time I wanted to investigate in the possibilities of using a chat bot to help any e-commerce website to answer product related questions (if possible even more complicated questions) and also from a back end perspective have a tracking of what is happening and how our bot is performing, what are the most requested products, how consumers feels about the products and of course all of this in real time !

So let’s start from the basics, what is the product that we want to sell ?

Since I’m a huge fallout fan and I’m playing Fallout 4 right now, I want to introduce you to the fantastic world of … Nuka Cola!

Yeah you will love it! The smell, the flavor and the radiations will make it the next most wanted beverage in the world!

We can have different types of Nuka Cola (Wild, Orange,etc..) and we want to explain the characteristics of each variant to the users of our bot.

I will leverage several technologies mainly Microsoft based but can achieve the same with many other bot/analytics technologies (check here ).

Let’s start with the bot itself that we will build with Microsoft Bot Framework.

You need at least : 1 Hotmail, Live, Outlook.com account, 1 azure subscription linked to it and some dev account into the channels you want to use for your bot (Facebook developer account for example).

I reused a VM already with Visual Studio 2015 and after upgrading it to the latest patch level, I installed the bot framework visual studio project template and I also installed the bot emulator to test the bot locally.

The procedure is well explained here.

Now that we have a bot running locally we want to add “some intelligence” right?

The intelligent service that will help us to make a bot that is able to understand human language is LUIS , where will introduce what actually our bot is able to understand and what are the concepts that he is able to distill from a message.

First we need to create a new LUIS application (that will became later a simple api endpoint that we have to call) and we need to define at least three things: intents , action parameters and entities, but these concepts can be easily explained with our example:

Intent: I want to understand which type of Nuka Cola (Action Parameter) the consumer is interested .

Action Parameter: the parameter NukaColaType has to match an Entity.

Entity: List of all possible Nuka Cola variants

So what we will do on LUIS is the following:

  1. Create an Entity called NukaColaVariants
  2. Create an Intent called ProductInfoRequest
  3. Define inside ProductInfoRequest a mandatory Action Parameter called NukaColaType that matches the Entity NukaColaVariants

Here an screenshot:

luisAnd now? Well now the magic happens! Click on new utterances and start typing possible requests that your nukacola customers probably will do like:

“Tell me more about nuka cola dark” or

“What about nuka cola orange?”

After you record an utterance you will define the intent for it and then highlight the part of the phrase where the action parameter is defined and the matching entity.

In this way , utterance after utterance, LUIS will automatically be able to answer, but more importantly he will be smart enough to understand some like “how does nuka cola quartz taste like?” even if we never typed this utterance inside LUIS.

You can also look at LUIS errors and help him to understand some phrases that he was not able to classify properly.

Once we think that our LUIS model is kind of ok (I inserted 3-4 different utterances to start), you can publish the LUIS app and this action will give you a full api URL with inside your application id and subscription key.

Now bringing all this “Intelligence” to our bot program will be super complicated right? Api calls, object mappings, parameters in, parameters out, try catch…..

Instead it will be actually super super easy using the LuisDialog Class , check here or here for the details!

Now our bot using the emulator is answering amazingly in the emulator, but we want to use it live,right?

So from VS2015 we publish the bot to our Azure Subscription , register the bot on the bot developer portal and add/configure the channels that you want (I opted for telegram and facebook).

All the steps are described here.


Do you want to try ?

Go to the nukabot page on facebook to chat with my bot or try the telegram bot.

Ok now we have our bot answering to facebook and telegram like a champion but if this was really a bot answering hundreds of requests per hour we cannot watch all the chats and have an idea of what is happening.

We need some analytics that in real time processes the information and gives us an idea of what is happening.

I created this PowerBI Dashboard:

dashThanks to this dashboard in real time I can see what is going on and what is the feeling of my customers about my nuka cola products!

Let’s see how to do that.

First step Logic Apps :

logicWhat we do here is to create an endpoint listening that will accept calls from our bot, call the Text Analytics Api on Azure to understand the sentiment from the text typed by the customer and finally send all the information to an event hub.

In order to send from Logic Apps info to an event hub you have to deploy the EventHubApi App published here using the magic “Deploy to azure” button and then discover the API with the “Show APIs for App Services in the same region” option when you add an action.

You can use the start a free ride of Text Analytics Api really simply clicking this link (provided you are logged in your azure subscription).

Since it is essentially a simple http endpoint processing json inputs and outputs you can use a simple Http connector.

A stream analytics job will in real time process the info coming from the event hub and populate the data on Power BI.

simplifiedStream analytics jobs just take one input (In this case event hub), transform it using a query and puts the results in an output (in this case a powerbi dataset).

The query we used is the following:

System.Timestamp as time,
COUNT(*) AS [Count],
AVG(score) AS [Score]
InputFromHub TIMESTAMP BY [timestamp]
TumblingWindow(second, 5)

So every 5 sec we take all the messages , we group them by nukacola type and channel and we compute the count of events and the average of the score.

That’s what we will see in real time on the dashboard.

Why we added Logic Apps into this? Can we call directly the event hub from the bot?  Why use the score only for analytics while it can and should be used to provide better feedback to the consumer in real time?

All of these and many other are great questions, some answers:

  1. I like Logic Apps because it exposed one end point and behind the scenes with 0 code I can create “monster” workflows that can do as many things as I want
  2. Using the score in real time it’s a great idea , but still I’m not able to think a way to have Luis and sentiment playing together nicely (I have to study more probably)

Now some clarifications related to data, data retention:

  1. I do not store any user identifier (my scope is only to understand if the bot is responding well I do not care who is the person actually writing)
  2. All the data is stored in powerbi at aggregated level (as you have seen with the query)
  3. The detailed data into the event hub is cleared automatically every day without any backup policy.

So at the end of the day I only observe stats about bot responses and I can look into LUIS errors and improve the responses of the bot.

Extending Salesforce Search with Azure Search using Logic Apps

Hi this time we want to bring inside the Salesforce platform the power of Azure search having as objective to index directly Salesforce entities.

Why this? Salesforce search is not enough? Of course Salesforce search capabilities are great but we can make it even greater if we can have things like fuzzy search, suggestions,etc.. that Azure Search offers out of the box.

How to achieve this? We can do a minimal project that can demonstrate quickly how we can add this functionality with ZERO impacts on existing Salesforce entities (no additional triggers or change in your existing code) but only a couple of additional visual force pages if you want.

The idea is to use Azure Logic Apps to detect record changes in Salesforce objects and refresh the azure search index when this happens.

Step 1 : Create the Azure Search Index Definition

We can use the rest API or directly the azure portal, let’s see the rest raw api call:

POST https://yoursearchservice.search.windows.net/indexes?api-version=2015-02-28
api-key: [yourApiKey]
Content-Type: application/json
"name": "myindex",
"fields": [
{"name": "id", "type": "Edm.String","key": true, "searchable": false},
{"name": "FirstName", "type": "Edm.String"},
{"name": "LastName", "type": "Edm.String"},
{"name": "Email", "type": "Edm.String"}
"suggesters": [
"name": "sg",
"searchMode": "analyzingInfixMatching",
"sourceFields": ["LastName"]

As you can see a real simple example with just SalesforceId, firstname, lastname and email indexed (we plan to index the Contact Objects). We add the suggester on the lastname, so you can test that even misspelling a surname the azure search will give you anyway a good tip on the person you wanted to find.

Step 2: Create an Azure Logic App

Here another simple process to put in place, with some minor complications due to the fact that search rest api do not expose still a good swagger definition so we have to go direct with http. We first login in salesforce with salesforce connector, then we pick the contact as object to watch.


Here the code view of the Azure Logic App:

"$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
"actions": {
"HTTP": {
"inputs": {
"body": "{'value': [{'@search.action': 'upload','id': '@{triggerBody()?['Id']}','FirstName': '@{triggerBody()?['FirstName']}','LastName': '@{triggerBody()['LastName']}','Email': '@{triggerBody()?['Email']}' }]}",
"headers": {
"Content-Type": "application/json",
"api-key": "yourapikey"
"method": "POST",
"uri": "https://yoursearchservice.search.windows.net/indexes/myindex/docs/index?api-version=2015-02-28"
"runAfter": {},
"type": "Http"
"contentVersion": "",
"outputs": {},
"parameters": {
"$connections": {
"defaultValue": {},
"type": "Object"
"triggers": {
"When_an_object_is_modified": {
"inputs": {
"host": {
"api": {
"runtimeUrl": "https://logic-apis-westeurope.azure-apim.net/apim/salesforce"
"connection": {
"name": "@parameters('$connections')['salesforce']['connectionId']"
"method": "get",
"path": "/datasets/default/tables/@{encodeURIComponent(encodeURIComponent('Contact'))}/onupdateditems"
"recurrence": {
"frequency": "Minute",
"interval": 1
"splitOn": "@triggerBody()?.value",
"type": "ApiConnection"

So what are we doing here?
Well every minute we check if any contact is changed and if yes we update the azure search index with the new information.
Note the splitOn option we have OOB with this kind of trigger that allows us , if more than one record is changed during the minute , to invoke the azure search automatically for each of this records without doing anything more!

Step 3: Enjoy it!

Now you can build any visualforce page you like to call the azure search api and leverage the incredible features this technology offers to you!

Try the azure search suggestions api with some ajax to propose suggestions while the user types, your call center users will love that!

Tips: You can call azure search just using  http requests with api key on the header and use the automatic json deserialization libraries that are available on apex to convert the responses in objects that you can map to the visualforce tags.


The Customer Paradigm Executive

Fun article this time ! 

Contact me /comment if you want to apply 😂😂😂 for the role!

Customer Paradigm Executive

Candidates must be able to mesh e-business users and grow proactive networks and evolve 24/7 architectures as well.

This position requires to syndicate innovative infomediaries and morph them with viral metrics in order to synergize back-end convergence.

The objective is to deliver brand wearable eyeballs and architect granular eyeballs deployed to B2B markets incentivizing leading-edge e-business and disintermediating 24/7 relationships.

You will also have to aggregate revolutionary communities and whiteboard end-to-end systems in order to orchestrate dynamic convergence and effectively monetize efficient interfaces that can morph scalable e-markets.