For packaging the sources of an Azure Serveless application, follow the instructions on Packaging .NET sources.
After the packaging has finished, you have to build the sources the following way:
dotnet build /p:Configuration=Release <deployment.sln> --output <output_dir> -p:CosmosDBSupport=false -p:TimerSupport=false -p:AzureQueueSupport=false -p:ServiceBusSupport=false -p:HttpSupport=true -p:BlobSupport=false -p:EventGridSupport=false -p:IntegratedSecuritySupport=<true/false>
Note that if the KB has GAM enabled, you have to add -p:IntegratedSecuritySupport=true at compilation time.
The <deployment.sln> is inside the zip package, under src\build folder.
In the following example, the Deployment Unit object is called "DpuWithoutGAM".

This feature is available since GeneXus 18 Upgrade 5