Let’s get started with Azure Function for Dynamics 365 CRM: Part 2 [Cloud Deployment]

Amit Prajapati
5 min readFeb 28, 2021

In the previous blog, we have learned how to create an azure function to connect with Dynamics 365 CRM and create an account record whenever an azure function is triggered by the HTTP request.

In this blog, we will learn how to deploy the Azure Function App to Azure Cloud so that we can trigger that function from anywhere.

Prerequisite

1. Microsoft Azure Account

2. Active Subscription [Create a Free trial or Pay-as-you-Go Subscription]

If you are creating an azure function for learning purposes, then go with Free Trial but if you are working on the development for your organization or client then go for a Pay-as-you-Go subscription.

Step 1: Create a resource on Azure Portal for Azure Function Deployment.

Login to the portal.azure.com with your account and click on Create a resource:

Azure Dashboard

Create a resource for Function App as mentioned below screenshot:

Select Function App

Here we will create a new resource group but If you don’t have any existing resources.

Create a new Resource Group
Name your Resource Group

Following are configuration details that you need to fill during the creation of the resource.

Function Name: It is a global URL to access the Azure Function App and it must be unique.

Publish: You can directly publish your code or use Docker Container for publishing your Azure function

Runtime stack: Here we are building the .net application so we will choose .Net as our Runtime stack to support Azure Function. We have multiple options we can create an azure function for Nodejs, Python, Java, Powershell core or you can use customer handler.

After configuration are you ready to click on “Review and Create”

Review and Create a Resource for Azure Function App

It will take a few minutes to create and deploy the Azure Function App in the cloud.

Step 2: Publishing the Azure Function from Visual Studio:

Open the Azure Function project in Visual studio. Right-click on the Project and click on the Azure.

Publish the Azure Function App from Visual Studio

You will get the below screen on that we need to click on the Start.

Click on Start to start configuring the publishing process

Now we will choose Azure as we are deploying the Azure Function on the Azure Cloud and click on Next:

Select Azure as Target for Deployment

Once you select the azure then it will open the configuration screen. In the configuration window, you need to log in with Azure Account with Active Subscription. Select the resource group and select the function app as mentioned below screenshot.

Select the Subscription Plan and Resource Group-> Function Name

After the configuration is finished click on Publish. It will take a few minutes to deploy the application to the cloud.

Click on Publish to publish on Azure Cloud

Step 3: Get Azure Function URL from Azure Portal:

Open newly create Function App in the Azure portal app and click on the Function App:

You will find the function1 has been deployed. Click on that function to open it.

Click to open the Function

To Get the Function URL click on the Get Function URL and copy the URL.

Click on Get Function URL and paste it on the notepad for further use.

Testing

We will require the API testing tool, here I am using Postman and the following is the link to download “Postman”. https://www.postman.com/downloads/

Open the Postman and click on the create a new tab. Select request as POST and paste the URL:

Request will be POST

After pasting the URL, click on Send:

Click on Send

Now, we will take look at Dynamics 365 CRM environment and check whether the account is created or not.

Before

You will see one record that was created from Local Machine

After

Records created from deployed azure function.

--

--

Amit Prajapati

I am Technical Consultant from Mumbai, India. I like to contribute my knowledge to the community and good social cause.