alpha

Guides a coding assistant to build Azure Functions in C# with the isolated worker model, dependency injection, async code, logging and resilient retries.
description: 'Guidelines and best practices for building Azure Functions in C# using the isolated worker model'
applyTo: '**/.cs, **/host.json, **/local.settings.json, **/.csproj'
FunctionsApplication.CreateBuilder(args) or HostBuilder in Program.cs for host setup and dependency injection.[Function("FunctionName")] and use strongly typed trigger and binding attributes.ILogger<T> injected through the constructor, not ILogger passed as a function parameter, for consistent structured logging.async/await for all I/O-bound operations; never block with .Result or .Wait().CancellationToken parameters where supported to enable graceful shutdown.Microsoft.Azure.Functions.Worker and Microsoft.Azure.Functions.Worker.Extensions.* NuGet packages.Program.cs using builder.Services.Add* extension methods for clean dependency injection.local.settings.json for local development; use Azure App Configuration or Application Settings for deployed environments.IConfiguration or environment variables.@Microsoft.KeyVault(SecretUri=...)) in App Settings for secrets in deployed environments.Managed Identity (DefaultAzureCredential) for authenticating to Azure services — avoid connection strings with keys wherever possible.host.json tuned per trigger type: configure maxConcurrentCalls, batchSize, and retry policies at the host level.AuthorizationLevel.Function or higher for production endpoints; reserve AuthorizationLevel.Anonymous only for public-facing APIs with explicit justification. Use ASP.NET Core integration (UseMiddleware, IActionResult returns) when using the ASP.NET Core integration model."0 */5 * * * *") for schedules; avoid RunOnStartup = true in production as it executes immediately on every cold start.MaxConcurrentCalls, dead-letter policies, and MaxDeliveryCount in host.json and Azure portal; handle ServiceBusReceivedMessage directly for advanced message control (complete, abandon, dead-letter).Microsoft.Azure.Functions.Worker.Extensions.EventGrid) over polling-based blob triggers for lower latency and reduced storage transaction costs.cardinality to many for batch processing; use EventData[] or string[] parameter types for batch mode; always checkpoint using the EventHubTriggerAttribute's built-in checkpointing.LeaseContainerName and manage lease containers separately from data containers.[QueueOutput], [BlobOutput], [HttpResult]).[BlobInput] and [BlobOutput] for blob read/write; prefer Stream over byte[] for large blobs to avoid memory pressure.[CosmosDBInput] for point reads and simple queries; for complex queries, inject CosmosClient via DI with Managed Identity.[ServiceBusOutput] for single-message sends; inject ServiceBusSender via DI for batching or advanced send scenarios.BlobServiceClient, ServiceBusClient, CosmosClient) as singletons using services.AddAzureClients() from the Azure.Extensions.AspNetCore.Configuration.Secrets package with DefaultAzureCredential.IOptions<T> or IOptionsMonitor<T> for strongly typed configuration sections.static state in functions; all shared state should flow through DI-registered services.HttpClient instances via IHttpClientFactory to manage connection pooling and avoid socket exhaustion.host.json using "retry" with fixedDelay or exponentialBackoff strategy for trigger-level retries.Microsoft.Extensions.Http.Resilience or Polly v8 (ResiliencePipeline) with retry, circuit breaker, and timeout strategies.IActionResult types (BadRequestObjectResult, NotFoundObjectResult) rather than throwing exceptions for expected error conditions.ILogger<T> with structured log properties: _logger.LogInformation("Processing message {MessageId}", messageId).builder.Services.AddApplicationInsightsTelemetryWorkerService() and builder.Logging.AddApplicationInsights() in Program.cs.TelemetryClient for custom events, metrics, and dependency tracking beyond what is automatically collected.host.json under "logging" to avoid excessive telemetry costs in production.Activity and ActivitySource from System.Diagnostics for distributed tracing context propagation between functions and downstream services.Task or use Durable Functions rather than blocking the function host thread.IEnumerable<EventData> or ServiceBusReceivedMessage[] arrays in a single function invocation rather than one message at a time.FUNCTIONS_WORKER_PROCESS_COUNT and maxConcurrentCalls appropriately for the hosting plan and expected throughput.WEBSITE_RUN_FROM_PACKAGE=1 in App Settings for faster cold starts by running directly from a deployment package.AuthorizationLevel.Function with function keys stored in Key Vault for internal API-to-API calls.Azurite (local Azure Storage emulator) and TestServer or the Azure Functions Core Tools.Microsoft.Azure.Functions.Worker.Testing helpers where available to construct mock FunctionContext instances.FunctionsStartup, IWebJobsStartup), suggest migrating to the isolated worker model and provide the migration path via dotnet-isolated-process-guide.DefaultAzureCredential and Key Vault references.RunOnStartup = true is set on a TimerTrigger in a production app, flag it as a risk and suggest using deployment slots or feature flags instead.async void is used in any function, flag it immediately — use async Task instead.Thread.Sleep or Task.Delay inside a function, suggest replacing with host-level retry policies or Polly resilience pipelines.© GitHub, Inc. · MIT · source · posted by @OpenSourceBuffGuy on promptparty.com


Suited man enters glowing elevator, floor display at 13
Writes a 30-second Korean mystery thriller in which a man's elevator opens onto an impossible floor 0, with scene beats, cinematography and sound design.
video-prompt, seedance, horror, thriller, short-film, cinematic, multi-shot, timed-beats, character-consistency, camera-movement, sound-effects, guardrails, structured-output, photorealistic, korea, night-scene, symmetry, moody, for-filmmakers, long-form, advanced, film-noir

Anime candy hero character sheet with turnarounds
Lays out a 16:9 anime hero-shooter character sheet for a candy-themed armored defender, with turnarounds, equipment panels and a colour palette.
video-prompt, character-sheet, character-design, anime, concept-art, game-assets, video-games, sci-fi, robots, white-background, multi-panel, vibrant-colors, kawaii, character-consistency, structured-output, text-rendering, widescreen, long-form, for-artists, for-designers, game-development, futuristic

Girl rides a bicycle past a summer shop
Directs a 10-second nostalgic hand-drawn animated clip of a young girl in a straw hat riding a red bicycle past a summer shop, with timed shots and one spoken line.
video-prompt, animation, anime, timed-beats, multi-shot, lip-sync, character-consistency, summer, illustration, guardrails, negative-prompt, widescreen, camera-movement, tracking-shot, vintage, cozy, storyboard, family-friendly, short-film, minimax
Loading reviews…
Loading comments…