Fabric pagination and long operations
Make inventory complete and operations bounded
Fabric list endpoints may paginate using opaque continuation tokens and continuation URLs. Long-running operations may respond with 202 and an operation location, identifier and recommended poll interval. Follow the endpoint contract rather than assuming every endpoint supports the same fields. Treat continuation and operation URLs as untrusted data: validate HTTPS, expected host and authorized path before attaching credentials. Disable or validate redirects in a real HTTP client.
A bounded read retry policy
A 429 can signal throttling. Follow documented Retry-After guidance; use a maximum retry count, deadline and conservative backoff when supported. Some capacity-related errors do not provide Retry-After. The lab stops for review on missing, malformed or out-of-budget delays rather than retrying blindly. Do not retry 401/403 repeatedly, and never apply the read retry policy to arbitrary writes. Do not present a partial inventory as complete.
Worked example 1 — follow two pages
Run python client.py in the lab directory. Its Mock object consumes a list of responses, recording reads and virtual waits without networking.
t = Mock(fixture["pages"])items = list_items(t)print([x["id"] for x in items], t.waits)First page yields two items; the second page initially returns 429 with Retry-After 3. Retrying that same page succeeds with one item. Predicted output: ['mock-r1', 'mock-m1', 'mock-r2'] [3]. Repeated URL, duplicate ID, unexpected host or exhausted page budget aborts the inventory. This simplified client expects continuationUri; token-only pagination needs endpoint-specific construction.
Worked example 2 — poll a mock operation
The initial response is 202 with Location and a two-second interval. Poll returns Running with a four-second interval, then Succeeded.
t = Mock(fixture["operation"][1:])print(poll(t, fixture["operation"][0]), t.waits)Predicted output: Succeeded [2, 4]. Failed and Canceled remain terminal non-success states. A poll budget exhaustion means the last observed state is not a final result. Some Fabric operations expose a result endpoint; others do not, so retrieve results only when the documented operation contract supports them.
Log evidence rather than secrets
Log an allowlisted event, HTTP status and approved correlation ID. The sample uses fixed fictional IDs, rejects other values, and never records authorization headers, response bodies or URLs containing query parameters. In production add structured error codes, actual validated correlation identifiers, operation timestamps and restricted retention. A durable intent record plus status reconciliation prevents blind repeat submissions; do not claim exactly-once behavior.
Practice and references
Run python verify.py. Explain why a page loop, suspicious continuation host, repeated 429 or unknown operation state cannot produce a complete success result. Extend the mock with a Failed response and confirm it does not return Succeeded. See pagination, long-running operations and throttling. Next: embedded analytics.