Category: Azure Logic Apps

Azure Logic Apps|synchronizing Teams with Blob storage

Hello Dynamics Enthusiast,

Working on cutting Edge technologies like Azure Logic Apps and contributing to the Dynamics community keeps me energetic. So Here I am, to provide you a step by step guide to sync Teams and Blob storage using Azure Logic Apps.  

Scenario: I came across a requirement where client wants synchronization between Teams and blob storage which should enable end user to attach file to Teams and attached file should be stored into Azure Blob Storage automatically.

Prerequisites: Azure Subscription, Storage Account in Azure Portal.

I am using trigger as SharePoint: When a file is created in folder because Teams Files are stored in SharePoint.It is easy to access the attached SharePoint site for the Teams.

Follow the below steps to achieve the objective.

#1: Logic Apps Blank Template creation

  • Sign in to the Azure portal with your Azure account credentials.
  • Go to the ‘Resource group’.(Either create a new ‘Resource group’ or use an existing one).
  • Create Logic app with blank Template.
  • Search for SharePoint trigger SharePoint: When a file is created in folder.

#2: Enter trigger information

  1. Site Address : Enter your share point site address.
  2. Folder Id : Browse the folder where the teams files are stored in share point.

Refer the below screen.

#3: Search for the blob storage action. I chose Create Blob action.

#4: Enter the action information.

  1. Select the folder path from blob storage (I chose container of blob storage. You can choose container or a folder within a container.)
  2. Select the Blob name.
  3. Select the Blob content.

Below is the summary screen of the Logic Apps to give you a better view.

Executed Logic Apps

Testing: It is important to test whatever you configured. So follow the below steps to validate your configuration.

#1: Before uploading the file, Teams and Blob storage view are as below.

Screen from Teams Before uploading the file.
Screen from Blob storage before the test execution.

#2: Upload a file in Teams.

While uploading the file in Teams
uploaded file

#3: Same file should be replicated in Blob Storage for successful validation of the configuration.

Bingo! Team and Blob synchronized successfully.

Hope it helps to some extent.

May the Dynamics Power be with you!

Azure Logic Apps:When a HTTP request is received|used case[Biz talk Server integration with Dynamics 365]

Hello Microsoft Enthusiast,

Azure is LCNC(low-code/no-code)development platform.There are several triggers available.It is always exciting to work and explore them.So I am demonstrating one of them i.e. When a HTTP request is received.

Scenario: This is the integration between Biz talk Server and Dynamics 365. Azure Logic Apps listens Biz talk Server whenever it receives JSON object and perform the further crud operation. My scenario operation is : If Account exists in Dynamics 365 then update the Account’s address details based on the received ‘Account Number’ from the biz talk server’s request in the Logic Apps.

Let’s start as follows:

#1: Create a logic apps with the template: ‘When a HTTP request is received’. When you click on ‘Save’ button endpoint will be generated automatically and click on ‘Use sample payload to generate schema’.After this a window will popup, paste the JSON(It is prerequisites for you and will differ case to case.) in pop-up window. In this way, ‘Request Body JSON Schema’ will get structured automatically.

Some of the sensitive data has been hidden in some of the screen shot.

#2: Initialize the variable for ‘Account Number’ and ‘Account ID’. Query the ‘List records’ to check whether the Account is present or not in Dynamics 365 based on the received Account Number from Biz talk request.

#3: loop the received input in ‘For each’ loop. Put the condition where Account Number is equal to Biz talk Account Number.

#4: If condition is true then set Account’s Guid in Account ID variable and update the address details in Acoount. Refer the below Screen.

#5: Send the ‘200’ Status Code as Response message to Biz talk Server. So that Biz talk get to know that sent request has been processed successfully. 😊

Test: Once Logic Apps received request from Biz talk, It updates Address details of particular Account.

Screen from Dynamics 365

If you want more clarification/information.Don’t forget to comment.I will be happy to assist you. 🙂

Hope it helps to some extent.

May the DynamicsPower be with you!

Azure Logic Apps|used case[Dynamics 365 Integration with HubSpot]

Azure Logic Apps|used case[Dynamics 365 Integration with HubSpot]

Hello Reader,

In my previous post, I had created custom Connector (If you want to see ‘how’ click here) and now time has come to use it. So, here I am integrating Dynamics to HubSpot using Microsoft Azure Logic Apps.

While working with Azure Logic App,you won’t have to write code in many cases. But if you have to, you will create code snippets with Azure Functions and run that code on-demand from Logic Apps.

Detailed steps are as below:

Step 1: Login to portal.azure.com with your credentials and create ‘Resource group’, if you already have one, kindly use that. I have created crm-int-hubspot Resource group for the demo purpose.

Step 2: Create a Logic App and name it as per your wish. Click on ‘Create’ and wait till it get deployed successfully to Resource group. Start with blank Template.

Step 3: Look for the Trigger. In my scenario, I opted Common Data Service then chose the trigger when contacts get created. After that map the dynamics 365 environment’s information accordingly.

Step 4: Now the question arises for connector. There is no out of box connector available yet, Therefore, I have created custom connector in my previous blog, so continuing with it, I selected Hubspot_CreateContact in Custom tab and below it chose Action Create Contact in HubSpot on creation of contact in Dynamics 365 as shown in below screen.

Step 5: Now add the value of HAPIKey (stands for HubSpot API Key,which interact with information and is unique for each instance) and properties. You can add any property which is defined in hubSpot. For the demo purpose, I am taking firstname, lastname and email 🙂

Step 6: Save Logic Apps and test it. 😊

Testing : Log-in to Dynamics 365 and create contact. The same contact will be created in HubSpot. Bingo!

Creating contact in Dynamics 365.
Same created in HubSpot.

With this, I am done with my HubSpot series. Stay tuned to get more live industry scenario.

Hope it helps to some extent.

May the DynamicsPower be with you ! 🙂

Azure Logic Apps Custom Connector|used Case[To create Contact in HubSpot]

Hello Reader,

Have a quick look on how to create Azure Logic App Custom Connector to create contact in HubSpot.

Disclaimer: I am assuming that you are familiar with Azure and have Azure Subscription to login on portal.azure.com with your credentials (If Not, you can comment to get more information/clarification.)

The steps are as follows:

Step 1: Create a new Resource Group if you don’t have, else start with the existing one like me. Go to the Resource Group and add Logic Apps Custom Connector and name your Custom Connector as per your wish and click on “Create”. Refer below Screen. Wait till it get deployed to resource group successfully.

Step 2:  Start with Rest API-end point and OPEN API file

Step 3: Scroll down a bit and fill the Host API base url (Currently working in General Tab) and click on the “Security”, you will be moved to Security tab.

Step 4: I chose No Authentication Since it will authenticate from HAPI key in its next Definition tab. Click on “Definition”.

Step 5: Welcome to Definition tab, Add Action by entering Summary, Description, Operation Id as below:

Step 6: Scroll down a bit within the same page and click on “import form sample” which you can find under ‘Request’.

Step 7: Please remain on the same page, you will get a pop-up window immediately on the right-hand side to fill-in the request information as:

Verb-Post,

URL-https://api.hubapi.com/contacts/v1/contact/?hapikey=demo,

Body

 {   
"properties":
[
{ "property": "email" },
{ "property": "firstname"},
{ "property": "lastname"},
{ "property": "website"},
{ "property": "company"},
{ "property": "phone"},
{ "property": "address"},
{ "property": "city"},
{ "property": "state"},
{ "property": "zip"}
]
}

After clicking on “Import”, the pop-up window will disappear.

Step 8: Click on “Update connector”, and you are good to go with your custom connector. You will get notification” Custom Connector has been successfully updated.”

This Connector will be used in my next blog. Stay tuned to see it in action.

Hope it helps to some extent !

May the DynamicsPower be with you ! 🙂