Skip to main content
Skip table of contents

Setting up Visual Studio Code

Setting up a project

Begin by creating a new project (Workspace - Create New Project).

image-20250220-100927.png

Navigate to the folder where you’d like to store your project and open it.

image-20250225-135607.png

Function Apps support multiple programming languages. This manual is based on C#. Other supported languages include JavaScript, TypeScript, Python, Java, Ballerina, etc.

image-20250220-101049.png

Make sure that the latest .NET is selected (.NET 8 in this example).

image-20250220-101242.png

Choose a template for the project's first function. Different trigger functions are available. This manual covers HTTP trigger and Timer trigger.

image-20250220-101426.png

Creating an HTTP trigger

Define a function name.

image-20250220-101531.png

Specify a namespace.

image-20250220-101607.png

Set the appropriate access rights for the function.

In this manual, the access level is set to Anonymous, but the final choice depends on company policy. For more details on access rights, refer to the Microsoft website.

image-20250220-102104.png

Check the final folder structure.

The primary program file is named <function_name>.cs. In the following example, the main file is HttpTriggerAU2opt.cs.

image-20250220-102225.png

Creating a Function App

Open the command palette and enter:
Create Function App in Azure

image-20250217-104234.png

Type a name for your Function App and press Enter.

image-20250217-104331.png

Set the latest .NET version as a runtime stack.

image-20250217-104410.png

Select a location for new resources.

image-20250217-104444.png

Wait until the following message appears:
Create Function App "<name>" Succeeded

image-20250217-104549.png

Creating an HTTPS trigger

Local trigger

To run the function locally, click Run → Start Debugging.

image-20250217-111708.png

Copy the generated localhost link and paste it into a browser of your choice. This will trigger the synchronization.

image-20250217-111853.png

Public URL HTTPS Trigger

To enable a public URL trigger, the application must be deployed to Azure. In the workspace, click Deploy to Azure and deploy it to the desired Resource Group.

image-20250217-115752.png
image-20250217-115804.png

HTTP Trigger - checking results

When clicking on either the localhost link or the public URL, the function triggers a process that executes the following steps:

  1. Retrieves data from the Entra Admin Center using Graph API.

  2. Processes the data based on the configured settings.

  3. Generates one or more of the following files:

    • m2f.csv

    • f2m.csv

    • f2m_interm.csv

  4. Uploads the files to Blob Storage (for customer reference of what is sent to Retarus).

  5. Retrieves the data from Blob Storage.

  6. Sends the data to the Retarus secure HTTPS endpoint.

If files with the same name already exist in the Blob Storage container, they are overwritten. Below is an example of a push requiring the files m2f.csv, f2m.csv, and f2m_interm.csv:

image-20250217-120307.png

If your email address is listed in Retarus Directory Synchronization as a recipient for user synchronization upload reports, you’ll receive an email for each service. This email may contain the pushed .csv files, if configured.

For Email-to-Fax, the email may look similar to this:

image-20250217-120410.png

For Fax-to-Email, the email may look similar to this:

image-20250217-120449.png

For detailed configuration instructions on Retarus User Synchronization via HTTPS Push (DirSync), refer to the following manuals:

Creating a Timer trigger

Enter a name for your timer-triggered function.

image-20250217-122123.png

Specify a namespace.

image-20250217-122203.png

Create a Timer trigger Cron job.

image-20250217-122237.png

Required Libraries (NuGet)

The following table lists the required dependencies that must be installed and referenced in your code.

Module

“Using” command

Package command (NuGet)

Newtonsoft

using Newtonsoft.json

dotnet add package Newtonsoft.Json --version 13.0.3

Azure Storage Blobs

using Azure.Storage.Blobs;

dotnet add package Azure.Storage.Blobs --version 12.19.1

CsvHelper

using CsvHelper;
using CsvHelper.Configuration;

dotnet add package CsvHelper --version 32.0.3

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.