Quotas, Monitoring & Security
TPM and PTU quota · 429 and retry · cost tracking · Foundry observability · AI Search health · Entra ID, RBAC, private endpoints
By the tools4free.dev team · Last reviewed November 13, 2026
Practice questions for this topic →
Quota, rate limits and capacity
- Quota is assigned to your subscription per region, per model and per deployment type, in units of tokens per minute (TPM). Each deployment you create is given a share of that quota.
- The TPM assigned to a deployment sets its TPM rate limit. A requests-per-minute (RPM) limit is also enforced, set in proportion to the TPM assignment. The RPM-to-TPM ratio varies by model, so programmatic deployments don't control the two values independently.
- Token rate-limit calculations use actual input and generated tokens, not the maximum output-token value in the request. A higher output-token limit doesn't reserve tokens against TPM.
- At the TPM limit, further requests get HTTP 429 until capacity is available. RPM is evaluated over short periods (typically 1 or 10 seconds), so uneven bursts can get 429 even when the per-minute total is below the limit.
- To view quota, assign Cognitive Services Usages Reader at the subscription scope. A resource group or resource-level assignment doesn't authorize the subscription-scoped Usages API.
- After you edit a quota allocation or submit a request, allow up to 15 minutes to propagate. Quota is shared between Foundry projects in the same subscription; the Quota page is under Manage.
- Quota increase requests are processed in the order received. Priority goes to customers who actively use their existing allocation.
| Deployment type | Billing | Latency SLA | Fits |
|---|---|---|---|
| Standard | Pay per token | None | Development, testing and production with variable or unpredictable traffic |
| Priority processing | Pay per token (priority tier rate) | Defined latency target per model | Latency-sensitive production without a long-term commitment |
| Provisioned (PTU) | Per PTU per hour (or Azure reservations) | Defined latency target per model | Mission-critical, high-scale production needing guaranteed throughput and consistent latency |
| Batch | Pay per token (discounted batch rate) | None | Bulk work with no latency requirement; results return asynchronously |
- A PTU is a fixed amount of model processing capacity, held for your deployment whether or not requests are being made. PTU quota is model-independent but region-specific (per subscription, per region, per deployment type).
- Quota is not capacity. Quota is a policy limit with no cost. Having PTU quota doesn't guarantee capacity: if capacity in the region is insufficient for the requested PTU count, the deployment fails. Deleting or scaling down a deployment releases its capacity back to the pool.
Handling throttling (429)
- Watch the rate-limit response headers (for example
x-ratelimit-remaining-requestsandx-ratelimit-remaining-tokens) to slow down before you hit a 429. - On a 429, wait for
retry-after-msif it is present. Otherwise use exponential backoff with random jitter and a maximum number of retries. - Don't resend in a tight loop: unsuccessful requests still count toward the per-minute limit.
- Reduce prompt size and cap generated output to what the scenario needs, because actual tokens count toward TPM.
The Python openai client retries 429 and transient errors with exponential backoff by default (two retries). Raise it with max_retries. If you wrap calls in a custom retry library such as tenacity, set max_retries=0 on the client so retries don't multiply.
Cost footprint
- Foundry has no dedicated page in the Azure pricing calculator because it is made of several optional Azure services. Estimate each service you use (for example Azure AI Search) in the calculator.
- Billing models: pay-as-you-go (billed by usage of each service) or commitment tiers (a fixed fee for predictable cost). Provisioned deployments bill per PTU per hour.
- Estimate-versus-actual workflow: deploy a small test workload, then in Cost Management group costs by Resource and then by Meter and compare to the estimate. Keep the same scope (subscription, resource group or resource) for both.
- Cost records can arrive late, so compare trend windows, not minute by minute. Update budgets and alert thresholds only after at least one full billing cycle trend.
- Evaluations in the agent playground are on by default for all Foundry projects and billed by consumption; you can turn them off by unselecting all evaluators.
Monitoring quality, safety and drift
Foundry observability has three parts: evaluation, monitoring and tracing. Monitoring is integrated with Azure Monitor Application Insights.
| Post-production signal | What it does |
|---|---|
| Operational metrics | Regular measurement of key agent metrics: token consumption, latency, error rates |
| Continuous evaluation | Quality and safety evaluation of production traffic at a sampled rate |
| Scheduled evaluation | Scheduled evaluation with test datasets to detect system drift |
| Scheduled red teaming | Scheduled adversarial testing for safety and security vulnerabilities |
| Azure Monitor alerts | Notifications when outputs fail quality thresholds or produce harmful content |
- The Agent Monitoring Dashboard (Monitor tab of an agent) reads telemetry from the Application Insights resource connected to the project. Data retention and billing follow that resource.
- Dashboard guidance: latency above 10 seconds might indicate throttling, complex tool calls or network issues; a run success rate below 95% warrants investigation of failed runs.
- To enable continuous evaluation rules, assign the project managed identity the Foundry User role.
- For an Azure OpenAI resource, the out-of-box dashboards cover HTTP Requests, Tokens-Based Usage, PTU Utilization and Fine-tuning. Platform metrics and the activity log are collected automatically; resource logs aren't stored until you create a diagnostic setting and route them.
- Grounding quality: Groundedness measures whether the response aligns with the given context without fabricating content (precision). Retrieval and Document Retrieval measure the retrieval step; Document Retrieval needs ground-truth labels.
AI Search ingestion and relevance health
| Indexer status | Meaning |
|---|---|
| In Progress | Active run; Docs Succeeded grows as it goes. High-volume indexers can look In Progress all the time |
| Success | Run finished. Can succeed even when some documents fail, if errors stay below Max failed items |
| Failed | Errors exceeded Max failed items and indexing stops |
| Reset | Change tracking was reset; the indexer re-runs in full over all documents |
- Indexer history shows up to 50 recent runs with start and end times, errors and warnings. Portal pages refresh every few minutes. Warnings (for example, no text in an image or PDF) don't always indicate a problem.
- Query health in the portal: search latency, queries per second (QPS) and throttled queries. Metrics are kept 30 days by default. For longer retention or to see query strings, enable diagnostic logging, preferably to a Log Analytics workspace (queries land in the AzureDiagnostics table).
- Throttling shows as HTTP 503 on queries; during indexing a 207 means some items failed. The usual fix is more replicas for query throttling or more partitions for indexing throttling, but find the cause first because both add cost.
- Test query metrics on a billable tier with one replica and one partition so the numbers are not averaged across nodes.
Identity, roles and private networking
- Foundry supports Microsoft Entra ID (token-based, keyless) and API keys. Use Entra ID for production: conditional access, managed identities and least-privilege RBAC. Keys suit rapid prototyping but lack per-user traceability. With a key, access is full and not limited by roles.
- Control plane (create resources and projects, deploy models, set up Private Link) uses RBAC actions. Data plane (build agents, run evaluations, tracing, fine-tuning) uses RBAC dataActions.
- Give the project's managed identity the Foundry User role on the Foundry resource, as well as your user.
| Role | Use it for |
|---|---|
| Foundry Agent Consumer | Only interact with agent endpoints; least privilege for agent consumers |
| Foundry User | Build and test agents in a project (data actions plus reader access) |
| Foundry Project Manager | Everything Foundry User does, publish agents, and assign Foundry User to others |
| Foundry Account Owner | Manage accounts, projects and models and assign roles; cannot build in projects |
| Foundry Owner | Full access to manage and build; highly privileged |
Foundry roles were renamed from Azure AI User, Azure AI Owner, Azure AI Account Owner and Azure AI Project Manager. Don't use the Azure AI Developer role for Foundry work: it is scoped to Azure Machine Learning workspaces and Foundry hubs.
- Disable keys on a Foundry Tools resource with the Azure policy Azure AI Services resources should have key access disabled (disable local authentication), the
disableLocalAuthproperty, orSet-AzCognitiveServicesAccount ... -DisableLocalAuth $true. It doesn't take effect immediately; test with an old key and expect HTTP 401. - Private networking has three parts: inbound to the Foundry resource, outbound from it, and outbound from the Agent client through virtual network injection. Inbound is set with the public network access (PNA) flag: disabled with a private endpoint, or selected networks/IP addresses.
- Create the private endpoint in the same region as the virtual network, approve it (without approval permissions the connection stays Pending until the resource owner approves), then fix DNS and check that the endpoint resolves to the private IP address. Removing private endpoints doesn't make the project public.
- Standard agent setups use bring-your-own Azure Storage, Azure AI Search and Azure Cosmos DB so agent data stays in your tenant. Trusted Azure services (Foundry Tools, Azure AI Search, Azure Machine Learning) can be allowed through a network rule exception and authenticate with managed identity.
- Azure AI Search: role-based access is optional but recommended (keys are the default). Search Service Contributor, Owner and Contributor can retrieve admin keys. Search Index Data Contributor is read-write on content; Search Index Data Reader is read-only. Data plane roles apply to all indexes by default.
- For outbound connections from Search (indexers, vectorizers, skills), enable a system-assigned or user-assigned managed identity on the search service and give it roles on the target. A system-assigned identity is one per search service. Only a system identity works for a same-region connection to Azure Storage.
CLI and PowerShell
| Task | Azure CLI | PowerShell |
|---|---|---|
| Retry 429s with the Python client (SDK exponential backoff) | client = AzureOpenAI(
azure_endpoint="https://<your-resource>.openai.azure.com/",
api_key="<your-api-key>",
api_version="2024-10-21",
max_retries=5 # up to 5 retries with automatic exponential backoff
) | - |
| Disable local (key) authentication on a Foundry Tools resource | - | Set-AzCognitiveServicesAccount -ResourceGroupName "my-resource-group" -Name "my-resource-name" -DisableLocalAuth $true |
| Check whether local authentication is disabled (DisableLocalAuth property) | - | Get-AzCognitiveServicesAccount |
Exam Tips
Tick each tip once you can answer it without looking.
“A deployment returns HTTP 429 although you set a large max output tokens” → Rate limits count actual input and generated tokens, not the configured maximum; the TPM or RPM limit was reached. Back off and retry.. Trap: A higher max output token value doesn't reserve tokens against TPM.
“429 appears when traffic arrives in bursts, though the per-minute average is under RPM” → RPM is evaluated over short windows (typically 1 or 10 seconds); spread requests evenly.. Trap: Assuming a one-minute total is all that matters.
“Retry on 429 with a custom library (tenacity)” → Set max_retries=0 on the client so retries don't multiply; use retry-after-ms or exponential backoff with jitter and a retry cap.. Trap: Tight retry loops: failed requests still count toward the limit.
“Quota page can't show usage for a developer” → Cognitive Services Usages Reader at the subscription scope.. Trap: A resource group or resource-level assignment doesn't authorize the subscription-scoped Usages API.
“Predictable high-volume chat, needs guaranteed throughput and low latency” → Provisioned deployment (PTU).. Trap: Standard is for variable traffic; Batch has no latency target.
“PTU deployment fails though you have PTU quota” → Quota isn't capacity: capacity in the region was insufficient. Check capacity or another region.. Trap: Requesting more quota doesn't create capacity.
“Estimate Foundry cost before building” → Azure pricing calculator, adding each service (Foundry has no single page).. Trap: Looking for a Foundry page in the calculator.
“Compare estimate to actual cost after a test workload” → Cost Management: group by Resource, then Meter, at the same scope as the estimate.. Trap: Reconciling minute by minute; use trend windows and a full billing cycle.
“Detect quality drift in a deployed agent over time” → Scheduled evaluation with test datasets; continuous evaluation samples live traffic; alerts notify on failures.. Trap: Red team scans are scheduled adversarial tests, a different signal.
“Agent Monitoring Dashboard shows no data” → Connect an Application Insights resource to the project.. Trap: Dashboard data isn't stored in the Foundry project itself.
“Indexer shows Success but some documents are missing” → Success is allowed while errors stay below Max failed items; open the run's errors and warnings.. Trap: Failed means errors exceeded Max failed items and indexing stopped.
“Search queries get 503 under load; indexing returns 207” → 503 is throttling; 207 means some items failed. Add replicas for queries, partitions for indexing.. Trap: Adding partitions to fix query throttling.
“Production app calls a model with a key stored in code” → Switch to Microsoft Entra ID (managed identity); disable local auth with the policy and test for HTTP 401.. Trap: Assuming disabling keys is instant.
“Users only need to call an agent endpoint” → Foundry Agent Consumer.. Trap: Foundry User also allows building in the project.
“Foundry resource must be reachable only from your network” → Private endpoint in the VNet's region, approved, with DNS resolving to the private IP; PNA disabled.. Trap: Only private endpoints in an Approved state can send traffic.
“Search indexer must read Blob Storage without keys” → Managed identity for the search service with a role on the storage account.. Trap: Connection strings with account keys.
Sources
- Manage Azure OpenAI in Foundry Models quota
- Provisioned throughput for Foundry Models
- Plan and manage costs (Foundry)
- Observability in generative AI
- Monitor agents with the Agent Monitoring Dashboard
- Monitor Azure OpenAI in Foundry Models
- RAG evaluators
- Azure AI Search: monitor queries
- Azure AI Search: monitor indexer status and results
- Azure AI Search: analyze performance
- Authentication and authorization in Foundry
- Role-based access control for Foundry
- Disable local authentication in Foundry Tools
- Configure network isolation for Foundry
- Azure AI Search: connect using Azure roles
- Azure AI Search: configure a managed identity
Checked against Microsoft Learn on November 13, 2026.