Azure Functions Primer
Deploy serverless compute that scales to zero. Wire Meridian license checks into HTTP-triggered functions with minimal cold-start overhead.
What you'll build
- An HTTP-triggered Node.js function behind a Meridian license gate
- Environment-based key injection via Azure portal — no hardcoded secrets
- Consumption-plan billing: pay per execution, zero idle cost
1. Scaffold the function
Install the Azure Functions Core Tools and create a new Node.js project. Choose the HTTP trigger template — it generates an index.js and a function.json binding file.
2. Add Meridian SDK
Pull the Meridian Node.js package. At the top of your handler, call the license-validate endpoint with the key stored inprocess.env.MERIDIAN_KEY. Return 403 immediately if the license is expired or revoked.
3. Cold-start strategy
Keep the Meridian SDK import outside the handler closure so it loads once per instance. Cache the validation result in module scope with a short TTL to avoid hitting the license server on every invocation.
4. Deploy & configure
Push to Azure via the CLI or GitHub Actions. In the portal, setMERIDIAN_KEY as an application setting. Enable Application Insights to monitor license-check latency and failure rates.
Pro tip: Use the Consumption plan's free grant of 1M executions/month to prototype without cost. Scale to Premium when you need VNet integration or always-warm instances.