Setting up Visual Studio Code
Setting up a project
Begin by creating a new project (Workspace - Create New Project).

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

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

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

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

Creating an HTTP trigger
Define a function name.

Specify a namespace.

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.

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

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

Type a name for your Function App and press Enter.

Set the latest .NET version as a runtime stack.

Select a location for new resources.

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

Creating an HTTPS trigger
Local trigger
To run the function locally, click Run → Start Debugging.

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

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.


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:
Retrieves data from the Entra Admin Center using Graph API.
Processes the data based on the configured settings.
Generates one or more of the following files:
m2f.csv
f2m.csv
f2m_interm.csv
Uploads the files to Blob Storage (for customer reference of what is sent to Retarus).
Retrieves the data from Blob Storage.
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
:

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:

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

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.

Specify a namespace.

Create a Timer trigger Cron job.

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 |
|
|
Azure Storage Blobs |
|
|
CsvHelper |
|
|