Skip to content

Commit a92c1b5

Browse files
authored
Added description for x-ms-*-request-id
Added the intended usage pattern for the azure specific request id values.
1 parent 9bda096 commit a92c1b5

File tree

1 file changed

+37
-20
lines changed

1 file changed

+37
-20
lines changed

azure/Guidelines.md

Lines changed: 37 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -167,25 +167,27 @@ Array | One of a) a comma-separated list of values (preferred), or b) separ
167167

168168
The table below lists the headers most used by Azure services:
169169

170-
Header Key | Applies to | Example
171-
------------------- | ---------- | -------------
172-
_authorization_ | Request | Bearer eyJ0...Xd6j (Support Azure Active Directory)
173-
_x-ms-useragent_ | Request | (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
174-
traceparent | Request | (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
175-
tracecontext | Request | (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
176-
accept | Request | application/json
177-
If-Match | Request | "67ab43" or * (no quotes) (see [Conditional Requests](#Conditional-Requests))
178-
If-None-Match | Request | "67ab43" or * (no quotes) (see [Conditional Requests](#Conditional-Requests))
179-
If-Modified-Since | Request | Sun, 06 Nov 1994 08:49:37 GMT (see [Conditional Requests](#Conditional-Requests))
180-
If-Unmodified-Since | Request | Sun, 06 Nov 1994 08:49:37 GMT (see [Conditional Requests](#Conditional-Requests))
181-
date | Both | Sun, 06 Nov 1994 08:49:37 GMT (see [RFC7231, Section 7.1.1.2](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.2))
182-
_content-type_ | Both | application/merge-patch+json
183-
_content-length_ | Both | 1024
184-
_x-ms-request-id_ | Response | 4227cdc5-9f48-4e84-921a-10967cb785a0
185-
ETag | Response | "67ab43" (see [Conditional Requests](#Conditional-Requests))
186-
last-modified | Response | Sun, 06 Nov 1994 08:49:37 GMT
187-
_x-ms-error-code_ | Response | (see [Handling Errors](#Handling-Errors))
188-
retry-after | Response | 180 (see [RFC 7231, Section 7.1.3](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.3))
170+
Header Key | Applies to | Example
171+
----------------------- | ---------- | -------------
172+
_authorization_ | Request | Bearer eyJ0...Xd6j (Support Azure Active Directory)
173+
_x-ms-useragent_ | Request | (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
174+
traceparent | Request | (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
175+
tracecontext | Request | (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
176+
accept | Request | application/json
177+
If-Match | Request | "67ab43" or * (no quotes) (see [Conditional Requests](#Conditional-Requests))
178+
If-None-Match | Request | "67ab43" or * (no quotes) (see [Conditional Requests](#Conditional-Requests))
179+
If-Modified-Since | Request | Sun, 06 Nov 1994 08:49:37 GMT (see [Conditional Requests](#Conditional-Requests))
180+
If-Unmodified-Since | Request | Sun, 06 Nov 1994 08:49:37 GMT (see [Conditional Requests](#Conditional-Requests))
181+
date | Both | Sun, 06 Nov 1994 08:49:37 GMT (see [RFC7231, Section 7.1.1.2](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.1.2))
182+
_content-type_ | Both | application/merge-patch+json
183+
_content-length_ | Both | 1024
184+
_x-ms-request-id_ | Response | 4227cdc5-9f48-4e84-921a-10967cb785a0 (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
185+
_x-ms-client-request-id_| Both | 227cdc5-9f48-4e84-921a-10967cb785a1 (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
186+
_x-ms-return-client-request-id_| Request | true (see [Distributed Tracing & Telemetry](#Distributed-Tracing--Telemetry))
187+
ETag | Response | "67ab43" (see [Conditional Requests](#Conditional-Requests))
188+
last-modified | Response | Sun, 06 Nov 1994 08:49:37 GMT
189+
_x-ms-error-code_ | Response | (see [Handling Errors](#Handling-Errors))
190+
retry-after | Response | 180 (see [RFC 7231, Section 7.1.3](https://datatracker.ietf.org/doc/html/rfc7231#section-7.1.3))
189191

190192
:white_check_mark: **DO** support all headers shown in _italics_
191193

@@ -767,7 +769,14 @@ In the rare case where a server rolls back a version that clients are already us
767769

768770
### Repeatability of requests
769771

770-
The ability to retry failed requests for which a client never received a response greatly simplifies the ability to write resilient distributed applications. While HTTP designates some methods as safe and/or idempotent (and thus retryable), being able to retry other operations such as create-using-POST-to-collection is desirable.
772+
The ability to retry failed requests for which a client never received a response greatly simplifies the ability to write resilient
773+
774+
775+
776+
777+
778+
779+
uted applications. While HTTP designates some methods as safe and/or idempotent (and thus retryable), being able to retry other operations such as create-using-POST-to-collection is desirable.
771780

772781
:ballot_box_with_check: **YOU SHOULD** support repeatable requests according as defined in [OASIS Repeatable Requests Version 1.0](https://docs.oasis-open.org/odata/repeatable-requests/v1.0/repeatable-requests-v1.0.html).
773782

@@ -993,6 +1002,14 @@ Client libraries are required to send telemetry and distributed tracing informat
9931002
- [Azure SDK Distributed tracing policy](https://azure.github.io/azure-sdk/general_azurecore.html#distributed-tracing-policy)
9941003
- [Open Telemetry](https://opentelemetry.io/)
9951004

1005+
In addition to distributed tracing, Azure also uses a set of common correlation headers:
1006+
1007+
|Name |Applies to|Description|
1008+
|-----------------------------|----------|-----------|
1009+
|x-ms-client-request-id. |Both |Optional. Caller-specified value identifying the request, in the form of a GUID with no decoration such as curly braces (e.g. `x-ms-client-request-id: 9C4D50EE-2D56-4CD3-8152-34347DC9F2B0`). If the caller provides this header the service **must** log this with their traces to facilitate tracing a single request. Because this header can be client-generated, it should not be assumed to be unique by the service implementation.
1010+
|x-ms-return-client-request-id|Request. |Optional. If specified, the service **must** include a `x-ms-client-request-id` header with the corresponding value in the response. Allows clients to correlate responses with requests.
1011+
|x-ms-request-id |Response |Required. Service generated correlation id identifying the request, in the form of a GUID with no decoratoin such as curly braces. In contrast to the the `x-ms-client-request-id`, the service **must** ensure that this valu is globally unique. Services should log this value with their traces to facilitate tracing of a single request.
1012+
9961013
## Final thoughts
9971014
These guidelines describe the upfront design considerations, technology building blocks, and common patterns that Azure teams encounter when building an API for their service. There is a great deal of information in them that can be difficult to follow. Fortunately, at Microsoft, there is a team committed to ensuring your success.
9981015

0 commit comments

Comments
 (0)