How do I see the logs of my model calls on Azure OpenAI?

Kab 0 Reputation points
2025-07-21T15:32:00.4533333+00:00

Hello!

I've set up log analytics in Azure OpenAI and activated Request+Response logging, and can see model calls being made. However, how do I see the logs of my actual model calls, with the details and content of the model output? I'm looking to something as similar to OpenAI's native logs (https://platform.openai.com/logs) as possible.

My current KQL query:

AzureDiagnostics
| where ResourceProvider == "MICROSOFT.COGNITIVESERVICES"
| where OperationName == "Completions_Create"
| order by TimeGenerated desc

Azure OpenAI Service
Azure OpenAI Service
An Azure service that provides access to OpenAI’s GPT-3 models with enterprise capabilities.
{count} votes

1 answer

Sort by: Most helpful
  1. Chakaravarthi Rangarajan Bhargavi 1,190 Reputation points MVP
    2025-07-22T16:49:29.2333333+00:00

    Hi Kab,

    Welcome to Microsoft Q&A!

    It's great to hear that you've already enabled Log Analytics and configured Request + Response logging for your Azure OpenAI resource. You're on the right track!

    To view detailed logs of your model calls (inputs and outputs) in a way similar to OpenAI platform logs, here's how you can go deeper:

    Step-by-step: View Model Call Logs with Request & Response Details

    1. Confirm Diagnostic Settings Ensure you have enabled logging to a Log Analytics workspace and selected:
      • AllLogs
      • AuditLogs
      • RequestResponseLogs (this is critical for payload visibility)
      Refer: Enable diagnostic logging
    2. Use KQL to Query Logs You can use the following refined KQL query to retrieve request and response content:
         AzureDiagnostics
      

    | where ResourceProvider == "MICROSOFT.COGNITIVESERVICES" | where OperationName == "Completions_Create" or OperationName == "ChatCompletions_Create" | project TimeGenerated, Resource, OperationName, ResultType, requestPayload_s, responsePayload_s | order by TimeGenerated desc

       
       > `requestPayload_s` contains the **prompt or chat messages** 
       > `responsePayload_s` shows the **model's generated response**
       
       **Filter or Expand** You can also add filters like `ResultType` or `Resource` to narrow down by success/failure or specific resource group.
       
       **View in Azure Monitor or Workbook** For ongoing monitoring, you may pin this query to a workbook or dashboard for better visibility.
       
    Please note the below items:
    
    Logs may take a few minutes to appear after execution.
    
    If you're not seeing `requestPayload_s` or `responsePayload_s`, double-check that **"RequestResponseLogs"** is enabled in your diagnostics settings.
    
    Some sensitive data may be redacted for compliance.
    
    Please refer the below articles if thats useful too
    
    [Supported Logs for Cognitive Services](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/supported-logs/microsoft-cognitiveservices-accounts-logs)
    
    [Log Analytics KQL Reference](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/log-query-overview)
    
    [Azure AI Engineer Certification Guide](https://learn.microsoft.com/en-us/credentials/certifications/azure-ai-engineer)
    
    Feel free to follow up if you'd like help customizing your query further or exporting results! Happy building with Azure OpenAI. 
    
    Regards, 
    
     **Bhargavi Chakaravarthi Rangarajan** 
    
    - If this answer helped you, please consider clicking **"Accept Answer"** and **upvoting** it so others in the community can benefit too.
    
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.