v1.31.0
conocimientocloud-configpatterns/

azure-functions.md

Referencia que cloud-config carga bajo demanda desde su SKILL.md.

cloud-configskill
patternscarpeta
1955 Btamaño
2026-09-08último cambio del pack

Skill: cloud-config

Worker aislado (.NET 10) con triggers comunes.


Program.cs (Isolated Worker)

var host = new HostBuilder()
    .ConfigureFunctionsWebApplication()
    .ConfigureServices((context, services) =>
    {
        services.AddApplicationInsightsTelemetryWorkerService();
        services.ConfigureFunctionsApplicationInsights();
        services.AddDbContext<AppDbContext>(o =>
            o.UseSqlServer(context.Configuration.GetConnectionString("Default")));
    })
    .Build();
await host.RunAsync();

Timer Trigger

[Function("ProcessPending")]
public async Task Run(
    [TimerTrigger("0 */5 8-20 * * 1-5")] TimerInfo timer,
    CancellationToken ct)
{
    _logger.LogInformation("Timer ejecutado: {Time}", DateTime.UtcNow);
    await _service.ProcessAsync(ct);
}

HTTP Trigger

[Function("GetScholarships")]
public async Task<HttpResponseData> GetAll(
    [HttpTrigger(AuthorizationLevel.Function, "get", Route = "scholarships")] HttpRequestData req,
    CancellationToken ct)
{
    var scholarships = await _service.GetAllAsync(ct);
    var response = req.CreateResponse(HttpStatusCode.OK);
    await response.WriteAsJsonAsync(scholarships, ct);
    return response;
}

Service Bus Trigger

[Function("ProcessMessage")]
public async Task Run(
    [ServiceBusTrigger("cola", Connection = "ServiceBus")] ServiceBusReceivedMessage message,
    ServiceBusMessageActions actions, CancellationToken ct)
{
    try
    {
        var payload = message.Body.ToObjectFromJson<MiMessage>();
        await _service.ProcessAsync(payload, ct);
        await actions.CompleteMessageAsync(message, ct);
    }
    catch (Exception ex)
    {
        _logger.LogError(ex, "Error procesando {MessageId}", message.MessageId);
        await actions.DeadLetterMessageAsync(message, cancellationToken: ct);
    }
}

Pattern 1.0.0

← Volver a la ficha de cloud-config

Ovillo v1.31.0tag v1.31.0 (2026-10-06) · sin decisiones posteriores69 skills · 19 agents · 22 hooks · 3 reglas · 15 tools · 103 decisionesfuente: ovillo/.claude/skills/cloud-config/patterns/azure-functions.mdCopyright 2026 Hugo Valer Rojas · Apache-2.0