05 de dezembro de 2026
Dataverse: service protection limits e os 429 em integrações
Entenda os service protection limits do Dataverse, por que integrações em volume tomam HTTP 429 e como projetar clientes resilientes com Retry-After, batch e EnableAffinityCookie.
Toda integração de alto volume com o Dataverse acaba esbarrando nos service protection API limits. Eles não são opcionais, não são negociáveis por SKU e não desaparecem comprando mais capacidade: são limites por usuário e por servidor que protegem a plataforma de um único cliente monopolizar recursos compartilhados. Quem projeta uma carga de migração, uma sincronização noturna ou um conector customizado sem conhecê-los descobre na pior hora — em produção, com HTTP 429 em cascata.
O que exatamente é limitado
Os service protection limits avaliam o consumo por combinação de usuário autenticado e servidor web do Dataverse, em janelas deslizantes de 5 minutos. Há três gatilhos independentes, e estourar qualquer um deles resulta em 429 Too Many Requests:
- Número de requisições: por volta de 6.000 requisições por servidor, por usuário, em 5 minutos.
- Tempo de execução acumulado: cerca de 20 minutos (1.200 segundos) de tempo combinado de execução por servidor, por usuário, em 5 minutos. Requisições pesadas (queries complexas, plugins síncronos caros) consomem esse orçamento rápido mesmo com poucas chamadas.
- Número de conexões concorrentes: em torno de 52 conexões simultâneas por servidor, por usuário.
O ponto crucial é o "por servidor": o ambiente é servido por múltiplos front-ends, e a mesma identidade pode cair em servidores diferentes a cada conexão. Isso tem implicação direta na estratégia de paralelismo, como veremos.
Esses limites são diferentes dos limites de API do Power Platform
Não confunda service protection limits com os Power Platform request limits (as 40.000 requisições em 24h por licença). São camadas distintas: os request limits de 24h são de licenciamento/entitlement e raramente são o gargalo de uma integração técnica; os service protection limits são de proteção de infraestrutura em janela curta e são o que de fato derruba uma carga mal projetada. Um job pode estar muito abaixo do teto diário e ainda assim tomar 429 por disparar tudo nos primeiros minutos.
Respeitar o Retry-After não é opcional
Quando o Dataverse retorna 429, a resposta inclui o header Retry-After com o número de segundos que o cliente deve esperar antes de tentar de novo. A regra de ouro: honre esse valor exatamente. Nada de backoff exponencial inventado por cima de um 429 de service protection — o servidor já lhe disse quanto esperar, e ignorar isso só prolonga o bloqueio.
O SDK organizational service client (ServiceClient) do Dataverse já trata isso automaticamente por padrão, re-tentando e respeitando o Retry-After. Quem chama a Web API diretamente (via HTTP em Power Automate, Azure Function ou custom connector) precisa implementar o tratamento à mão:
- Capturar o status 429.
- Ler o header
Retry-After(em segundos). - Aguardar exatamente esse tempo.
- Re-tentar a mesma requisição de forma idempotente.
Sem idempotência, re-tentar é perigoso: use Upsert com alternate key ou chaves determinísticas para que a repetição não crie duplicatas.
Reduzir o número de chamadas com batch
A melhor defesa contra service protection limits é simplesmente fazer menos requisições. A Web API suporta $batch, que empacota várias operações em um único request HTTP. Isso derruba a contagem de requisições e, combinado com Content-ID para referenciar registros criados dentro do mesmo batch, permite criar pai e filhos numa só chamada.
Algumas considerações de produção sobre batch:
- Um batch com
changeseté transacional — tudo ou nada; um erro faz rollback de todas as operações do changeset. - Mantenha batches moderados (dezenas a ~100 operações, não milhares) para evitar timeout e facilitar o diagnóstico de falha.
- O tempo de execução de um batch grande ainda conta contra o orçamento de 20 minutos de execução — batch reduz contagem de requisições e conexões, não necessariamente tempo de CPU.
Paralelismo: controlado e com affinity cookie
Como o limite de conexões é por servidor, você pode ganhar throughput distribuindo chamadas entre os front-ends. Aqui entra o header x-ms-dataverse-request-affinity. Por padrão, com affinity habilitada, o cliente tende a ficar grudado no mesmo servidor (bom para cache). Para cargas de escrita massiva, a recomendação da Microsoft é desabilitar a affinity (x-ms-dataverse-request-affinity: Disabled) para que as requisições se espalhem pelos servidores e o limite de conexões concorrentes seja avaliado contra um pool maior.
Ainda assim, não saia disparando centenas de threads. Um grau de paralelismo moderado (algo como 2 a 4 vezes o número de núcleos lógicos da máquina cliente, ajustado por teste) costuma entregar o melhor throughput antes que o tempo de execução acumulado vire o gargalo real.
Um padrão de referência para carga em volume
Para uma migração ou sincronização pesada em Azure Function ou aplicação externa:
- Autentique com um service principal (application user) dedicado à integração — isole-a dos usuários interativos para que o throttling de um não afete o outro.
- Agrupe as operações em batches com changesets, usando
Upsertpor alternate key para idempotência. - Desabilite o affinity cookie para distribuir a carga entre servidores.
- Use paralelismo moderado e meça; não assuma que mais threads = mais rápido.
- Implemente tratamento de 429 que honra
Retry-Afterà risca, com re-tentativa idempotente. - Monitore o tempo de execução acumulado — se queries ou plugins síncronos estão caros, otimize-os em vez de simplesmente paralelizar mais.
Quando o certo é sair do padrão de chamada direta
Se a carga é tão grande que o orçamento de execução por janela vira o limitante crônico, repense a arquitetura: ingestão em staging com processamento assíncrono em fila do Dataverse ou Service Bus, uso de ImportData/bulk para cargas iniciais, ou mover a agregação pesada para fora do Dataverse (Synapse/Fabric Link) em vez de martelar a Web API. Service protection limits são um sinal de que a plataforma transacional não deveria estar carregando um workload analítico.
Projetar integrações que convivem bem com os service protection limits é uma das diferenças entre uma solução que escala e uma que trava na primeira carga real de produção. Se a sua empresa opera integrações críticas com o Dataverse e quer uma arquitetura resiliente a throttling desde o desenho, a Dynamic Soluções pode ajudar a estruturar isso com governança e suporte contínuo.
Every high-volume integration with Dataverse eventually runs into the service protection API limits. They aren't optional, they can't be bought away with a bigger SKU, and more capacity won't make them disappear: they are per-user, per-server limits that keep a single client from monopolizing shared resources. Anyone who designs a migration load, a nightly sync or a custom connector without accounting for them finds out the hard way — in production, with cascading HTTP 429s.
What exactly gets limited
Service protection limits track consumption per combination of authenticated user and Dataverse web server, within sliding 5-minute windows. There are three independent triggers, and breaching any one of them returns 429 Too Many Requests:
- Number of requests: roughly 6,000 requests per server, per user, in 5 minutes.
- Accumulated execution time: about 20 minutes (1,200 seconds) of combined execution time per server, per user, in 5 minutes. Heavy requests (complex queries, expensive synchronous plugins) burn through this budget fast even with few calls.
- Number of concurrent connections: around 52 simultaneous connections per server, per user.
The critical part is "per server": the environment is served by multiple front-ends, and the same identity may land on different servers across connections. That has a direct bearing on your parallelism strategy, as we'll see.
These limits are not the Power Platform API limits
Don't confuse service protection limits with the Power Platform request limits (the 40,000 requests per 24h per license). They are distinct layers: the 24h request limits are a licensing/entitlement matter and are rarely the bottleneck of a technical integration; service protection limits are short-window infrastructure protection and are what actually takes down a poorly designed load. A job can sit well below its daily ceiling and still hit 429 by firing everything in the first few minutes.
Honoring Retry-After is not optional
When Dataverse returns 429, the response includes a Retry-After header with the number of seconds the client must wait before trying again. The golden rule: honor that value exactly. No homemade exponential backoff layered on top of a service protection 429 — the server already told you how long to wait, and ignoring it only prolongs the block.
The Dataverse organizational service client SDK (ServiceClient) handles this automatically by default, retrying and respecting Retry-After. Anyone calling the Web API directly (via HTTP in Power Automate, an Azure Function or a custom connector) must implement the handling by hand:
- Catch the 429 status.
- Read the
Retry-Afterheader (in seconds). - Wait exactly that long.
- Retry the same request idempotently.
Without idempotency, retrying is dangerous: use Upsert with an alternate key or deterministic keys so the repeat doesn't create duplicates.
Cut the number of calls with batch
The best defense against service protection limits is simply making fewer requests. The Web API supports $batch, which packs multiple operations into a single HTTP request. That drops the request count and, combined with Content-ID to reference records created within the same batch, lets you create parent and children in one call.
Some production considerations about batch:
- A batch with a
changesetis transactional — all or nothing; one error rolls back every operation in the changeset. - Keep batches moderate (dozens to ~100 operations, not thousands) to avoid timeouts and ease failure diagnosis.
- The execution time of a large batch still counts against the 20-minute execution budget — batching reduces request count and connections, not necessarily CPU time.
Parallelism: controlled, with the affinity cookie
Since the connection limit is per server, you can gain throughput by spreading calls across the front-ends. This is where the x-ms-dataverse-request-affinity header comes in. By default, with affinity enabled, the client tends to stick to the same server (good for caching). For heavy write workloads, Microsoft recommends disabling affinity (x-ms-dataverse-request-affinity: Disabled) so requests spread across servers and the concurrent connection limit is evaluated against a larger pool.
Even so, don't fire off hundreds of threads. A moderate degree of parallelism (something like 2 to 4 times the number of logical cores on the client machine, tuned by testing) usually delivers the best throughput before accumulated execution time becomes the real bottleneck.
A reference pattern for high-volume loads
For a heavy migration or sync in an Azure Function or external application:
- Authenticate with a service principal (application user) dedicated to the integration — isolate it from interactive users so one's throttling doesn't affect the other.
- Group operations into batches with changesets, using
Upsertby alternate key for idempotency. - Disable the affinity cookie to spread the load across servers.
- Use moderate parallelism and measure; don't assume more threads = faster.
- Implement 429 handling that honors
Retry-Afterstrictly, with idempotent retry. - Monitor accumulated execution time — if queries or synchronous plugins are expensive, optimize them instead of just parallelizing harder.
When the right move is to leave the direct-call pattern
If the load is so large that the per-window execution budget becomes the chronic limiter, rethink the architecture: staging ingestion with asynchronous processing via a Dataverse queue or Service Bus, using ImportData/bulk for initial loads, or moving heavy aggregation out of Dataverse (Synapse/Fabric Link) instead of hammering the Web API. Service protection limits are a sign that the transactional platform shouldn't be carrying an analytical workload.
Designing integrations that coexist well with service protection limits is one of the differences between a solution that scales and one that stalls on its first real production load. If your company runs critical Dataverse integrations and wants an architecture that's resilient to throttling from day one, Dynamic Soluções can help structure it with governance and ongoing support.
