This tutorial leverages the power of Auth0 Log Events to create a responsive sales pipeline using Azure Event Grid.
Identity management is so much more than simply lock and key. While login events are the doorway into your product, sign-up events are the first opportunity to welcome your customers to their new home. Auth0 Log Streaming provides near real-time access to these events, providing you with the ability to respond instantly the moment they step foot through your door.
With Event Grid, Azure takes us one step further and provides us with a virtual valet — helping us to build event-driven applications, and routing our events to powerful, cloud-based services.
What is Azure Event Grid?
Azure Event Grid is a highly-available event router that collects data from multiple sources and delivers them to Azure services. Whether it is streaming stock quotes via Service Bus and broadcasting to your users via WebSockets, or integrating your Auth0 identity data and kicking off serverless flows using Azure Functions, Event Grid is there to make it easy to develop serverless workflows, system automation, and distributed applications.
One of the cool ways to leverage this integration is to automate intake tasks into your CRM. Instead of requiring your sales team to dig through email lists and enter in new leads, we can generate them and notify our teams within moments of their arrival.
In this tutorial, we will see just how easily we can leverage the power of this new integration by using Auth0 Log Events to build a CRM pipeline.
What are we Building?
CRM professionals will tell you that organic growth is far more likely to lead to a sale than outreach. Now with Azure and Auth0, you can feed every new sign-up directly into your CRM with minimal latency between customer action and engagement, generating new leads just as fast as they arrive.
In this tutorial, you will be building an automatic Sales Leads pipeline using Microsoft’s CRM solution, Dynamics 365, in order to build a sales prospect pipeline.Every time a new user signs up for your service through Auth0’s user flow, a corresponding new potential sales lead will be populated in Dynamics 365.
Requirements:
- An Auth0 account. Currently, log-streaming is not supported for free past-the-trial-date or PSaaS accounts, however, you can sign up for a free Auth0 trial account here.
- A Microsoft Azure subscription
- Access to a Microsoft Dynamics 365: Sales account — we will run through the trial setup if you don't have one
Let’s get started!
Step 1: Set up an Auth0 Event Source
In order to complete this step, you should know:
- Your Microsoft Azure Subscription ID
- Your relevant Azure Resource Group
- The Azure region in which you will create your Partner Topic
Part of the integration process is to set Auth0 as an Azure event source. Here's how you do that:
- Log in to the Auth0 Dashboard.
- Navigate to "Logs" > "Streams.
- Click "+ Create Stream".
- Select Azure Event Grid and enter a unique name for your new stream.
- Create the event source by providing your Azure Subscription ID, Azure Region, and a Resource Group name.
- Click Save.
Step 2. Activate your Auth0 Partner Topic in Azure
Activating the Auth0 topic in Azure allows events to flow from Auth0 to Azure.
- After clicking "Save", click the link underneath your newly created Partner Topic in the Auth0 portal.
- You will now be redirected to your Partner Topic in the Azure Portal.
- Confirm the
Partner Topic
field matches your Auth0 account. - Click "Activate".
Step 3. Sign Up for a Dynamics 365: Sales Account
- Set up your Dynamics 365 Sales Account trial, if applicable.
- Click "Sales", fill out the form, and get started!
- If you already have an account, sign in.
Step 4. Create a Logic App
- Search Logic Apps in the search bar in Azure.
- Create the app using your subscription, resource group, and desired region.
- Go to resource once deployment completes.
- In "Logic App Designer", under "Start with a common trigger", click "When a Http Request is Received".
In the popup, add the sample schema of an Auth0 log. Alternatively, you can paste a sample payload to generate a schema following the link underneath the sample schema prompt:
{
"type": "object",
"properties": {
"specversion": {
"type": "string"
},
"id": {
"type": "string"
},
"source": {
"type": "string"
},
"type": {
"type": "string"
},
"datacontenttype": {
"type": "string"
},
"data": {
"type": "object",
"properties": {
"date": {
"type": "string"
},
"type": {
"type": "string"
},
"description": {
"type": "string"
},
"connection": {
"type": "string"
},
"connection_id": {
"type": "string"
},
"client_id": {
"type": "string"
},
"client_name": {
"type": "string"
},
"ip": {
"type": "string"
},
"user_agent": {
"type": "string"
},
"details": {
"type": "object",
"properties": {
"body": {
"type": "object",
"properties": {
"tenant": {
"type": "string"
},
"client_id": {
"type": "string"
},
"connection": {
"type": "string"
},
"email": {
"type": "string"
},
"password": {
"type": "string"
},
"request_language": {
"type": "string"
}
}
},
"device_id": {
"type": "string"
}
}
},
"user_id": {
"type": "string"
},
"user_name": {
"type": "string"
},
"strategy": {
"type": "string"
},
"strategy_type": {
"type": "string"
},
"log_id": {
"type": "string"
}
}
}
}
}
Your Logic App will generate a URL upon save. Please copy this for later. Click "Run".
Next, you'll connect to Dynamics 365.
Step 5. Connect to 365
First, click on "+ New step". Select Dynamics 365. If "Dynamics 365" does not appear, search for it in the search bar.
- Click "Actions: Create a New Record".
- Sign in to 365 as asked.
- Populate the Org name.
- Entity Name: Leads (for sales leads).
- Populate the fields as desired (with dynamic fields popup).
- Save and then click "Run".
Next, let's create the new event subscription.
Step 6. Create Event Subscription
- Create new event subscription.
- In Event Schema, select "Cloud Event Schema v1.0".
- For Topic Types, select "Event Grid Topics"
- Populate the Subscription and Resource Group.
- Under "Endpoint Details":
- Select "Web Hook" as "Endpoint Type".
- Then paste the endpoint.
- Next, click the "Filters" tab:
- For Advanced Filters, user the following:
- Key:
data.type
- Operator:
string is in
- “ss”
- Key:
- Click "Create".
- For Advanced Filters, user the following:
Step 7. Generate a Sign up Log and View Your New Sales Leads
Congratulations! In seven simple steps, you have now created an automated sales pipeline!
Learn more
Using Azure Event Grid with Auth0 amplifies the possibilities for customization and protection of the end-user experience. Learn how to set up the Azure Event Grid Log Streams integration here, or sign up for a free Auth0 trial.
About Auth0
Auth0 by Okta takes a modern approach to customer identity and enables organizations to provide secure access to any application, for any user. Auth0 is a highly customizable platform that is as simple as development teams want, and as flexible as they need. Safeguarding billions of login transactions each month, Auth0 delivers convenience, privacy, and security so customers can focus on innovation. For more information, visit https://auth0.com.