1. Build Azure Function
Working as part of the PrioritZ fusion team you will be configuring a custom connector for a new API you build using Azure Functions. The team has decided to move the logic when a user creates a new “ask” to the Azure Function API. This will keep the Power App formula simple and allow more complex logic to be added in the future. In this lab you will create the function, use the Dataverse API, secure the API with Azure AD, configure a custom connector to use the API, and change the Power App to use the connector.
In Exercise 1 you install Azure tools extension for Visual Studio Code and create the function.
This lab requires an 🅰️Azure subscription (or trial) in the same tenant as your Dataverse environment.
1.1 Create Azure Function
- Launch Visual Studio Code.
- Click Terminal and select New Terminal.
- Go to the terminal and run the command below to create new folder.
md ContosoFunctions
- Select Azure Tool and click Sign in to Azure.
A browser popup should appear. Provide your Azure credentials and login.
Press
[CONTROL + SHIFT + P]
to open the command palette.Type create new project and select Create new project.
- Select the ContosoFunctions folder you created and click Select.
- Select
C#
for language. - Select
.NET 6 LTS
for .NET runtime.
- Select
HTTP trigger with OpenAPI
for template. - Enter CreateTopic for function name and
ENTER
.
Enter Contoso.PrioritZ for namespace and
ENTER
.Select Anonymous for AccessRights. Later we will protect the function using Azure AD.
Select Open in current window.
- Your function should open in Visual Studio Code.
- Click Terminal and select Run Build Task.
The build should succeed. Go to terminal and press any key close it.