Table of contents

Official Content

When deploying your services (Rest services, API objects, or services of a mobile/Android app) to Azure serverless, the following has to be considered if the app uses GeneXus Access Manager (GAM)

Use Redis to persist the web session

Serverless is stateless by default.
But since GAM uses the web session, it is necessary to use Azure Cache for Redis in such scenarios.

How to deploy to Azure serverless and use Redis 

First, define an Azure Cache for Redis service in the cloud. Get the Access Keys because you will need them afterwards.
At the deployment phase (using the Application Deployment tool inside GeneXus IDE or MSBuild tasks), you have to set the required information to indicate the Redis instance and its credentials.

The following image shows the deployment dialog and how to set the properties in the Session State configuration section.


Using MSBuild directly, the properties are as follows:


For example, for Azure Cache for Redis the configuration could be:

"AZURE_FUNCTIONS_SESSION_PROVIDER_ADDRESS" =,password=xxxxxxxxxxxxxxxxxxx=,ssl=True,abortConnect=False

Note that in this case, you can set the provider Address property with the "Primary Connection string" of the Redis cache. Also, note that in this figure, the instance name is "gxredis".


Session Timeout 

The session is renewed with each request; that is, each request resets the time counter to zero and starts again. That is how it happens on the web, where your session expires only due to inactivity after X minutes.

Configure GAM settings

In order to connect to GAM, the services must have a valid GAM Repository connection.

In the serverless cloud architecture, the GAM connection key is retrieved using an Azure Application Setting (an environment variable in general terms), called GX_GAMCONNECTIONKEY.
This Application setting is automatically defined by the Deploy Engine through the GAM connection Key property at the deployment dialog, although you can define it yourself in the cloud if you want.

You can see it in the Azure Function configuration settings using the Azure portal.


Using the Application Deployment tool, you can set the property in the GAM configuration section:


The connection key can be set using the following MSBuild property:


Where is the GAM connection key to configure the property for deployment obtained?

The GAM connection key can be obtained from connection.gam, which contains that key.

Note: For the time being, you have to always set the GAM connection key property at the deployment if you have GAM, regardless if you are only packaging the deployment and not uploading it to Azure. That is, even though you will be defining the GX_GAMCONNECTIONKEY App Setting yourself in the cloud, you have to set a value in the GAM connection key property to make your application connect to GAM.

Last update: April 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant