Skip to content

Commit

Permalink
Azure functions deploy changes (#119)
Browse files Browse the repository at this point in the history
Co-authored-by: Sabrina Juarez Garcia <[email protected]>
  • Loading branch information
sjuarezgx and Sabrina Juarez Garcia authored Dec 6, 2024
1 parent e804fb0 commit bafb91e
Show file tree
Hide file tree
Showing 9 changed files with 327 additions and 43 deletions.
26 changes: 26 additions & 0 deletions src/AzureFunctions/Templates/NET/blob.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using GeneXus.Deploy.AzureFunctions.BlobHandler;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using Microsoft.Azure.Functions.Worker;
using System.IO;

namespace BlobTriggerFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;
public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]
public void Run([BlobTrigger("$class.blobPath$", Connection = "$class.connectionName$")] Stream blobItem, FunctionContext context)
{
BlobTriggerHandler function = new BlobTriggerHandler(_callmappings);
function.Run(blobItem, context);
\}

\}
}$
}
26 changes: 26 additions & 0 deletions src/AzureFunctions/Templates/NET/cosmosdb.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using GeneXus.Deploy.AzureFunctions.CosmosDBHandler;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using Microsoft.Azure.Functions.Worker;
using System.Collections.Generic;

namespace CosmosDBTriggerFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;
public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]
public void Run([CosmosDBTrigger(databaseName:"$class.databaseName$", containerName:"$class.containerName$", Connection = "$class.connectionName$", LeaseContainerName ="$class.leaseContainerName$",LeaseContainerPrefix ="$class.leaseContainerPrefix$",LeaseDatabaseName ="$class.leaseDatabaseName$",LeaseConnection ="$class.leaseConnection$")] IReadOnlyList<Dictionary<string, object>> doc, FunctionContext context)
{
CosmosDBTriggerHandler function = new CosmosDBTriggerHandler(_callmappings);
function.Run(doc, context);
\}

\}
}$
}
26 changes: 26 additions & 0 deletions src/AzureFunctions/Templates/NET/eventgridazureschema.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Azure.Messaging.EventGrid;
using GeneXus.Deploy.AzureFunctions.EventGridHandler;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using Microsoft.Azure.Functions.Worker;

namespace EventGridAzureSchemaFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;
public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]
public void Run([EventGridTrigger(IsBatched =true)] EventGridEvent[] events, FunctionContext context)
{
EventGridTriggerHandlerAzure function = new EventGridTriggerHandlerAzure(_callmappings);
function.Run(events, context);
\}

\}
}$
}
26 changes: 26 additions & 0 deletions src/AzureFunctions/Templates/NET/eventgridcloudevents.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Azure.Messaging;
using GeneXus.Deploy.AzureFunctions.EventGridHandler;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using Microsoft.Azure.Functions.Worker;

namespace EventGridCloudEventFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;
public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]
public void Run([EventGridTrigger(IsBatched = true)] CloudEvent[] events, FunctionContext context)
{
EventGridTriggerHandlerCloud function = new EventGridTriggerHandlerCloud(_callmappings);
function.Run(events, context);
\}

\}
}$
}
26 changes: 26 additions & 0 deletions src/AzureFunctions/Templates/NET/queue.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Azure.Storage.Queues.Models;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using GeneXus.Deploy.AzureFunctions.QueueHandler;
using Microsoft.Azure.Functions.Worker;

namespace QueueTriggerFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;
public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]
public void Run([QueueTrigger("$class.queueName$", Connection = "$class.connectionName$")] QueueMessage queueMessage, FunctionContext context)
{
QueueTriggerHandler function = new QueueTriggerHandler(_callmappings);
function.Run(queueMessage, context);
\}

\}
}$
}
27 changes: 27 additions & 0 deletions src/AzureFunctions/Templates/NET/servicebusqueue.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Threading.Tasks;
using Azure.Messaging.ServiceBus;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using GeneXus.Deploy.AzureFunctions.ServiceBusHandler;
using Microsoft.Azure.Functions.Worker;

namespace ServiceBusQueueFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;
public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]
public async Task Run([ServiceBusTrigger("$class.queueName$", Connection = "$class.connectionName$", IsBatched = true, IsSessionsEnabled=$class.sessionEnabled$)] ServiceBusReceivedMessage[] receivedMessages, FunctionContext context)
{
ServiceBusTriggerHandler function = new ServiceBusTriggerHandler(_callmappings);
await function.Run(receivedMessages, context);
\}

\}
}$
}
27 changes: 27 additions & 0 deletions src/AzureFunctions/Templates/NET/servicebustopic.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Threading.Tasks;
using Azure.Messaging.ServiceBus;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using GeneXus.Deploy.AzureFunctions.ServiceBusHandler;
using Microsoft.Azure.Functions.Worker;

namespace ServiceBusQueueFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;

public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]
public async Task Run([ServiceBusTrigger("$class.topicName$","$class.subscriptionName$", Connection = "$class.connectionName$", IsBatched = true, IsSessionsEnabled=$class.sessionEnabled$)] ServiceBusReceivedMessage[] receivedMessages, FunctionContext context)
{
ServiceBusTriggerHandler function = new ServiceBusTriggerHandler(_callmappings);
await function.Run(receivedMessages, context);
\}
\}
}$
}
26 changes: 26 additions & 0 deletions src/AzureFunctions/Templates/NET/timer.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using Microsoft.Azure.Functions.Worker;
using GeneXus.Deploy.AzureFunctions.Handlers.Helpers;
using GeneXus.Deploy.AzureFunctions.TimerHandler;

namespace TimerTriggerFunctions
{
$classes:{class |
public class $class.className$
{
private ICallMappings _callmappings;
public $class.className$(ICallMappings callMappings)
{
_callmappings = callMappings;
\}

[Function("$class.functionName$")]

public void Run([TimerTrigger("$class.timerSchedule$")] TimerInfo timerInfo, FunctionContext context)
{
TimerTriggerHandler function = new TimerTriggerHandler(_callmappings);
function.Run(timerInfo, context);
\}

\}
}$
}
Loading

0 comments on commit bafb91e

Please sign in to comment.