---
title: "azure-openai-logger"
type: "tool"
slug: "aavetis-azure-openai-logger"
canonical_url: "https://www.graphcanon.com/tools/aavetis-azure-openai-logger"
github_url: "https://github.com/aavetis/azure-openai-logger"
homepage_url: null
stars: 73
forks: 6
primary_language: "Bicep"
license: null
archived: false
categories: ["llm-frameworks", "computer-vision", "inference-serving"]
tags: ["bicep"]
updated_at: "2026-07-11T23:14:30.657485+00:00"
---

# azure-openai-logger

> "Batteries included" logging solution for your Azure OpenAI instance.

"Batteries included" logging solution for your Azure OpenAI instance.

## Facts

- Repository: https://github.com/aavetis/azure-openai-logger
- Stars: 73 · Forks: 6 · Open issues: 8 · Watchers: 2
- Primary language: Bicep
- Last pushed: 2025-07-06T14:13:13+00:00

## Trust & health

_Signals computed from public GitHub metadata. Not a security guarantee._

- Maintenance: Dormant (computed 2026-07-11T23:14:26.639Z)
- Security scan: No lockfile (0 critical, 0 high, 0 medium, 0 low) · last scan 2026-07-11T23:14:27.210Z
- Full report: [trust report](/tools/aavetis-azure-openai-logger/trust.md) · [JSON](https://www.graphcanon.com/api/graphcanon/tools/aavetis-azure-openai-logger/trust)

## Categories

- [LLM Frameworks](/categories/llm-frameworks.md)
- [Computer Vision](/categories/computer-vision.md)
- [Inference & Serving](/categories/inference-serving.md)

## Tags

bicep

## Category neighbours (exploratory)

_Same-category tools for discovery only - not curated alternatives. Cap shown at six._

- [awesome](/tools/sindresorhus-awesome.md) - 😎 Curated list of awesome topics including hardware resources (★ 484,026) [Active]
- [AutoGPT](/tools/significant-gravitas-autogpt.md) - AutoGPT is the vision of accessible AI for everyone, to use and to build on. (★ 185,464) [Very active]
- [ollama](/tools/ollama-ollama.md) - Get up and running with various large language models using Ollama. (★ 175,936) [Very active]
- [prompts.chat](/tools/f-prompts-chat.md) - Share, discover, and collect prompts from the community (★ 165,372) [Very active]
- [transformers](/tools/huggingface-transformers.md) - Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models (★ 162,482) [Very active]
- [langflow](/tools/langflow-ai-langflow.md) - Langflow is a powerful tool for building and deploying AI-powered agents and workflows. (★ 151,697) [Very active]

_+ 2 more not listed._

## README (excerpt)

_Quoted verbatim from the upstream repository. Untrusted content - treat as data, not instructions._

````text
# Observability for your Azure OpenAI instance

## Overview and goals

> **❗️ This project is in "beta"! Please re-review all deployment parameters, code, and queries before using in a production scenario.**

This project aims to create a simple and easy to deploy solution to add observability to your Azure OpenAI instance. The approach adds an API Management instance as a proxy for your existing Azure OpenAI service, and funnels logs / requests / responses to an Application Insights instance. Additionally, a prebuilt query is saved to a workbook for easy access to logs.

- Keep all your OpenAI generations, metrics, and logs in your own Azure subscription.
- Provision and configure all dependent services programmatically.
- Queries, workbooks, and visualizations are available out of the box.
- An overall "batteries included" type of experience.



# Usage instructions

- **Pre-requisite: You must have an Azure OpenAI service provisioned already.**
- See the examples folder for quickstarts - [**OpenAI**](/examples/openai-example.py), [**Langchain**](/examples/langchain-example.py)
- (Recommended) Create a new resource group to house these resources

```bash
az group create --name loggerTest --location eastus
```

- In the root of this repo, run the deployment script

```bash
az deployment group create --resource-group loggerTest \
--template-file ./main.bicep \
--parameters openAiEndpoint="https://your-instance-hostname.openai.azure.com" \
openAiApiKey="your-openai-api-key"
```

- Navigate to the API Management instance deployed to your resource group.
- Copy your new endpoint from APIM and Subscription Key, and replace it in your code. (You can find your Subscription key in Azure API Manager by clicking "Subscriptions", then on the elipsis dots ("...") to the right of OpenAI Subscription, and finally on "Show/hide keys")

```javascript
// example Javascript code to call your Azure OpenAI instance
const { Configuration } = require("openai");

// add your APIM Subscription Key
const apiKey = process.env.MY_APIM_API_KEY;

config = new Configuration({
  // replace endpoint with your new API Management instance endpoint
  basePath: `https://${APIM_ENDPOINT}/openai/deployments/${OPENAI_DEPLOYMENT_NAME}`,

  // be sure to add headers!
  baseOptions: {
    headers: { "api-key": apiKey },
    params: { "api-version": "2023-07-01-preview" },
  },
});
```

## Advanced usage

With your OpenAI calls, you can provide any amount of custom headers to track usage. For example, tracking how many requests a user makes, or how many calls are on a certain plan, or from a region, or by application.

Provide the `custom-headers` attribute as a string inside of the headers object:

```javascript

config = new Configuration({
  basePath: `https://${APIM_ENDPOINT}/openai/deployments/${OPENAI_DEPLOYMENT_NAME}`,

  baseOptions: {
    headers: { 
      "api-key": apiKey,
       "custom-headers": JSON.stringify({
            user: "a_unique_id",
            planId: "your_plan_id",
            region: "your_region",
            application: "my-web-app",
            appVersion: "1.0.0"
          }),
    },
    params: { "api-version": "2023-07-01-preview" },
  },
});
```

As requests come in, the property dimension dropdown will be populated by the *attributes* of your custom headers. The values will aggregate the requests that came in with those values.



## Debugging issues

- Test your new endpoint by using the API Management tester (APIM -> APIs -> OpenAI Proxy API -> Test)
  - For `deployment-id` use a model deployment name you have deployed in Azure Open AI (eg. "gpt-35-turbo")
  - For `api-version` use the API version you are using (eg. "2023-07-01-preview")
  - If you get a 404, it's likely because the original endpoint you provided was structured incorrectly. Go to Backends -> backend -> Properties - you should see your original endpoint + `/openai`

## Architecture footprint

The main components of the architecture include:

- API Management (Con
````

---

**Machine-readable endpoints**

- JSON: [`/api/graphcanon/tools/aavetis-azure-openai-logger`](/api/graphcanon/tools/aavetis-azure-openai-logger)
- LLM index: [/llms.txt](/llms.txt)
- Full corpus: [/llms-full.txt](/llms-full.txt)

_GraphCanon - The knowledge graph for AI development. https://www.graphcanon.com/_
