diff --git a/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md b/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md index 4321b25..f9c1c95 100644 --- a/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md +++ b/skills/ms-ai-engineering/references/api-management/genai-gateway-policies.md @@ -1,6 +1,6 @@ # GenAI-Specific APIM Policies & Rules -**Last updated:** 2026-02 +**Last updated:** 2026-06-24 **Status:** GA **Category:** API Management & AI Gateway @@ -322,11 +322,10 @@ Sett token-kvoter per dag, uke eller måned: + remaining-quota-tokens-variable-name="dailyRemaining" /> @@ -389,7 +388,8 @@ For å oppnå global rate limiting, bruk `quota-by-key` i stedet for `llm-token- | `TimeGenerated` | Tidspunkt for request | 2026-02-11T10:30:00Z | | `CorrelationId` | Unik request-ID | abc-123-def | | `OperationName` | API-operasjon | ChatCompletions | -| `ModelDeployment` | Deployment-navn | gpt-4o | +| `DeploymentName` | Deployment-navn | gpt-4o | +| `ModelName` | Modellnavn | gpt-4o | | `PromptTokens` | Antall prompt-tokens | 150 | | `CompletionTokens` | Antall completion-tokens | 250 | | `TotalTokens` | Totalt token-forbruk | 400 | @@ -409,7 +409,7 @@ ApiManagementGatewayLlmLog | project TimeGenerated, CorrelationId, - Model = ModelDeployment, + Model = DeploymentName, PromptTokens, CompletionTokens, Prompt = tostring(RequestArray.content), @@ -426,9 +426,15 @@ ApiManagementGatewayLlmLog ```kusto // Finn uvanlig høy token-bruk per bruker +// Brukeridentitet finnes ikke i ApiManagementGatewayLlmLog — join mot +// ApiManagementGatewayLogs på CorrelationId for UserId/ApimSubscriptionId. ApiManagementGatewayLlmLog | where TimeGenerated > ago(7d) -| extend UserId = tostring(CustomDimensions["UserId"]) +| join kind=leftouter ( + ApiManagementGatewayLogs + | where TimeGenerated > ago(7d) + | distinct CorrelationId, UserId + ) on CorrelationId | summarize AvgTokens = avg(toint(TotalTokens)), MaxTokens = max(toint(TotalTokens)), @@ -598,9 +604,9 @@ Outbound (fra topp til bunn): | Policy | Classic | V2 | Consumption | Self-hosted | Workspace | |--------|---------|-----|-------------|-------------|-----------| | `llm-content-safety` | Ja | Ja | Ja | Ja | Ja | -| `llm-token-limit` | Ja | Ja | Ja | Ja | Ja | -| `llm-semantic-cache-lookup` | Ja | Ja | Nei | Nei | Ja | -| `llm-semantic-cache-store` | Ja | Ja | Nei | Nei | Ja | +| `llm-token-limit` | Ja | Ja | Nei | Ja | Ja | +| `llm-semantic-cache-lookup` | Ja | Ja | Ja | Ja | Nei | +| `llm-semantic-cache-store` | Ja | Ja | Ja | Ja | Nei | | `llm-emit-token-metric` | Ja | Ja | Ja | Ja | Ja | ---