quinzee.cloud

Development edition · 16 November 2026. Commands using repository paths, Make targets or sample projects require access to the Quinzee source checkout. No public installer is available. Examples use disposable local environments.

Developer’s guide

13. Run HTTP and Service Bus functions

Quinzee runs your .NET isolated functions in a real Azure Functions v4 host. ARM/Bicep creates the plan and function app; a separate Docker helper starts its registered application image. HTTP requests enter through Quinzee's HTTPS gateway. Service Bus triggers connect from the function host to the broker.

Step 1: try the complete application

On the host, use the native build prerequisites, .NET 10 SDK, Python 3, OpenSSL and Docker. Build the fixture's local runner image, then run the example:

docker build --target lint --tag triglav-http-lint:local .
make functions-test

This builds the locked .NET project and application image, creates a temporary cloud/network/helper, deploys compiled Bicep, calls an HTTP function with and without its key, and sends work to the Service Bus trigger. It also exercises settings changes, restart, stop/start, helper recovery and deletion. Test-owned containers and the network are removed afterwards; this does not create a persistent QHQ environment. The initial image/package download needs network access. The following steps show the persistent deployment and invocation sequence so you can reproduce it without depending on the test's temporary state.

Step 2: inspect the function code

Start from the locked project in tests/compatibility/functions. Its packages provide the isolated worker, HTTP trigger and Service Bus extension. This is the complete Program.cs; use this separate Functions project, not the earlier console application's Program.cs:

// Real isolated-worker HTTP and Service Bus functions used by the emulator test.
// Quinzee Cloud - proprietary and confidential. All rights reserved.
using System.Collections.Concurrent;
using System.Net;
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Hosting;

await new HostBuilder().ConfigureFunctionsWorkerDefaults().Build().RunAsync();

public static class Functions
{
    private static readonly ConcurrentQueue<string> Received = new();

    [Function("Echo")]
    public static async Task<HttpResponseData> Echo(
        [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = "echo")] HttpRequestData request)
    {
        var response = request.CreateResponse(HttpStatusCode.OK);
        await response.WriteAsJsonAsync(new { message = "hello from a real function", setting = Environment.GetEnvironmentVariable("Greeting") });
        return response;
    }

    [Function("Messages")]
    public static async Task<HttpResponseData> Messages(
        [HttpTrigger(AuthorizationLevel.Function, "get", Route = "messages")] HttpRequestData request)
    {
        var response = request.CreateResponse(HttpStatusCode.OK);
        await response.WriteAsJsonAsync(Received.ToArray());
        return response;
    }

    [Function("Consume")]
    public static void Consume([ServiceBusTrigger("orders", Connection = "ServiceBusConnection")] string body)
    {
        if (Received.Count < 100) Received.Enqueue(body);
    }
}

HostBuilder starts the worker. Each Function attribute declares an entry point. The HTTP trigger requires a Function key. The Service Bus trigger names orders and reads its connection settings through the ServiceBusConnection prefix. The in-memory queue exists only to make trigger delivery visible in the tutorial; a production handler would write durable application state before completing.

Step 3: register an image for the persistent lab

Continue from the standalone quinzee-messaging group, bookbus namespace, orders queue and private connection file in chapter 12. Keep that cloud running. On the host:

make functions-example
python3 infrastructure/functions/register.py \
  --image quinzee-functions-example:local \
  --registry .local/functions-helper/images.json
make functions-run

Leave the last command running in its terminal. The helper uses the default standalone network/DNS, .local/quinzee cloud state and its own .local/functions-helper private state. It needs Docker access. Neither the cloud nor the function container receives a Docker socket or a CA signing key. The default trust root supports native service names; an Azure-named Service Bus connection additionally needs the emulation CA through the helper's --trust-ca option, so the hosted client verifies the Azure-name certificate as well as the native one. The helper accepts repeatable public CA files; it does not need the CA key.

Registration resolves the local tag to an immutable image ID and approves that code for execution. After rebuilding an image, register it again, restart the helper to read the registry, and restart the app. The helper never pulls an arbitrary image named by a deployment. To use your own app, publish its .NET 10 isolated project and build that output with infrastructure/functions/Dockerfile; then register the resulting local image.

Step 4: deploy the function app

In another host terminal, create a private ARM parameters file without printing the Service Bus credential:

python3 - <<'PY'
import json
import os
from pathlib import Path
os.umask(0o077)
directory = Path(".local/messaging")
parameters = {"parameters": {
    "appName": {"value": "book-functions"},
    "serviceBusConnection": {
        "value": (directory / "connection.txt").read_text().strip()}
}}
with (directory / "functions.parameters.json").open("x") as output:
    json.dump(parameters, output)
PY
make bicep-examples

In QHQ's deployment page, select quinzee-messaging and deploy .packages/tools/functions.json with .local/messaging/functions.parameters.json. It creates a Linux B1 plan and book-functions app, with Greeting set to from Bicep. Secure parameters remain sensitive in local files even though the template declares them secure.

Open Functions → Function apps and Refresh until the app is Running and provisioning succeeds. Updating means the host is not ready yet; keep the helper running. An unregistered image fails, and a missing helper times out after 180 seconds. A successful ARM lifecycle POST acknowledges the requested state; poll the resource to see whether the runtime has reached it.

Step 5: invoke HTTP and queue triggers

Save this as .local/messaging/invoke.py beside client.py, then run python3 .local/messaging/invoke.py from the host. The helper from chapter 12 keeps ARM credentials and function keys out of terminal output. This example uses default names and ports; adjust them together if you changed the lab.

import time
from client import access_token, group, request

app = group + "/providers/Microsoft.Web/sites/book-functions"
keys = request("POST",
    app + "/host/default/listkeys?api-version=2024-11-01", {})
headers = {"x-functions-key": keys["functionKeys"]["default"]}
host = "book-functions.functions.quinzee.cloud"
print(request("GET", "/api/echo", host=host, headers=headers))

bearer = access_token("https://servicebus.azure.net/.default")
request("POST", "/orders/messages", "invoice-42",
        host="bookbus.servicebus.quinzee.cloud",
        headers={"Authorization": "Bearer " + bearer,
                 "Content-Type": "text/plain"})
for _ in range(30):
    messages = request("GET", "/api/messages", host=host, headers=headers)
    if "invoice-42" in messages:
        print("Service Bus function received invoice-42")
        break
    time.sleep(1)
else:
    raise RuntimeError("Service Bus trigger did not receive the message")

The first response contains hello from a real function and from Bicep. The next success line confirms that the queue trigger ran the application's code. Do not run a competing receiver on orders during this check: either consumer can receive a queued message. Use a fresh message value for independent repeat checks, because the sample retains earlier deliveries until restart.

The real host enforces AuthorizationLevel.Function; an ARM bearer token is not the invocation key. Only /api/... routes are forwarded, and host administration paths are blocked. The gateway permits 64 KiB request/response bodies and a 10-second exchange; streaming and WebSockets are unsupported.

Use managed identity instead of a connection string

Run make functions-identity-test to verify the same Function with a user-assigned identity, Receiver role and SAS disabled. The complete Bicep is examples/provisioning/functions_identity.bicep. See the identity walkthrough for binding settings and system-assigned identity. The helper owns the token endpoint/header; application settings never contain its credential.

Step 6: stop or remove the lab

Use QHQ's Start, Stop and Restart actions and Refresh to check completion. To pause, Stop the app while the helper is running and wait for Stopped before ending the helper. Stopping only the helper leaves containers and Service Bus triggers running; gateway forwarding stops when the heartbeat becomes stale.

To remove the exercise, deliberately delete quinzee-messaging through QHQ while the helper is still running, and allow it to remove the owned runtime. This also deletes the lab's queue/topic messages. Deleted app names remain reserved by tombstones; choose a fresh app name for a new exercise. Private helper key files and local parameter files remain for explicit operator cleanup. Then close QHQ and use make qhq-env-down for its standalone environment.

This is a single-instance Linux .NET development runtime. Consumption/Flex scaling, slots, ZIP/Kudu deployment, other language workers, timer/Blob/Queue Storage triggers and Durable Functions are outside the verified subset. Use a separate compatibility exercise before adopting another binding. A package that compiles is not evidence that its dependent service exists locally.