Skip to content

Commit 4de14b7

Browse files
committed
A passel of minor fixes.
1 parent 50b14d3 commit 4de14b7

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

azure/Guidelines.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Where:
6464
| - | - |
6565
| service | Name of the service (ex: blobstore, servicebus, directory, or management)
6666
| cloud | Cloud domain name, e.g. `azure.net` (see Azure CLI's "az cloud list")
67-
| tenant | Globally-unique ID of container representing tenant isolation, billing, enforced quotas, lifetime of containees (ex: subscription UUID)
67+
| tenant | Globally-unique ID of container representing tenant isolation, billing, enforced quotas, lifetime of containers (ex: subscription UUID)
6868
| service‑root | Service-specific path (ex: blobcontainer, myqueue)
6969
| resource‑collection | Name of the collection, unabbreviated, pluralized
7070
| resource‑id | Value of the unique id property. This MUST be the raw string/number/guid value with no quoting but properly escaped to fit in a URL segment.
@@ -81,7 +81,7 @@ Some customer-provided path segment values may be compared case-insensitivity if
8181

8282
:white_check_mark: **DO** restrict the characters in service-defined path segments to `0-9 A-Z a-z - . _ ~`, with `:` allowed only as described below to designate an action operation.
8383

84-
:ballot_box_with_check: **YOU SHOULD** restrict the characters allowed in user-specified path segements (i.e. path parameters values) to `0-9 A-Z a-z - . _ ~` (do not allow `:`).
84+
:ballot_box_with_check: **YOU SHOULD** restrict the characters allowed in user-specified path segments (i.e. path parameters values) to `0-9 A-Z a-z - . _ ~` (do not allow `:`).
8585

8686
:ballot_box_with_check: **YOU SHOULD** keep URLs readable; if possible, avoid UUIDs & %-encoding (ex: Cádiz is %-encoded as C%C3%A1diz)
8787

@@ -170,9 +170,9 @@ The table below lists the headers most used by Azure services:
170170
Header Key | Applies to | Example
171171
------------------- | ---------- | -------------
172172
_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))
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))
176176
accept | Request | application/json
177177
If-Match | Request | "67ab43" or * (no quotes) (see [Conditional Requests](#Conditional-Requests))
178178
If-None-Match | Request | "67ab43" or * (no quotes) (see [Conditional Requests](#Conditional-Requests))
@@ -181,7 +181,7 @@ If-Unmodified-Since | Request | Sun, 06 Nov 1994 08:49:37 GMT (see [Condition
181181
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))
182182
_content-type_ | Both | application/merge-patch+json
183183
_content-length_ | Both | 1024
184-
_x-ms-request-id_ | Response | [see Customer Support](http://TODO:link-goes-here)
184+
_x-ms-request-id_ | Response | 4227cdc5-9f48-4e84-921a-10967cb785a0
185185
ETag | Response | "67ab43" (see [Conditional Requests](#Conditional-Requests))
186186
last-modified | Response | Sun, 06 Nov 1994 08:49:37 GMT
187187
_x-ms-error-code_ | Response | (see [Handling Errors](#Handling-Errors))
@@ -199,6 +199,10 @@ retry-after | Response | 180 (see [RFC 7231, Section 7.1.3](https://da
199199

200200
Note: RFC 1123 defines the date format as a modification of the date format in [RFC 822, Section 5](https://datatracker.ietf.org/doc/html/rfc822#section-5) to support either a 2 or 4 digit year, and further recommends that a 4 digit year always be used.
201201

202+
:white_check_mark: **DO** create an opaque value that uniquely identifies the request and return this value in the `x-ms-request-id` response header.
203+
204+
Your service should include the `x-ms-request-id` value in error logs so that users can submit support requests for specific failures using this value.
205+
202206
:no_entry: **DO NOT** fail a request that contains an unrecognized header. Headers may be added by API gateways or middleware and this must be tolerated
203207

204208
:no_entry: **DO NOT** use "x-" prefix for custom headers, unless the header already exists in production [[RFC 6648](https://datatracker.ietf.org/doc/html/rfc6648)].
@@ -674,7 +678,7 @@ Azure services need to change over time. However, when changing a service, there
674678

675679
:white_check_mark: **DO** review any API changes with the Azure API Stewardship Board
676680

677-
:white_check_mark: **DO** use an `api-version` query parameter with a date value
681+
:white_check_mark: **DO** use an `api-version` query parameter with a `YYYY-MM-DD` date value, with a `-preview` suffix for a preview service.
678682

679683
```http
680684
PUT https://service.azure.com/users/Jeff?api-version=2021-06-04
@@ -806,7 +810,7 @@ Some common situations where the RELO pattern should be used:
806810

807811
:white_check_mark: **DO** support a get method on the resource that returns a representation of the resource including the status field that indicates when the operation has completed.
808812

809-
:white_check_mark: **DO** define the "status" field of the resource as an enum with all the values it may contain including the "terminal" values "Succeeded", "Failed", and "Canceled".
813+
:white_check_mark: **DO** define the "status" field of the resource as an enum with all the values it may contain including the "terminal" values "Succeeded", "Failed", and "Canceled". See [Enums & SDKs](#enums--sdks-client-libraries).
810814

811815
:ballot_box_with_check: **YOU SHOULD** use the name `status` for the "status" field of the resource.
812816

@@ -963,8 +967,8 @@ When supporting optimistic concurrency:
963967
| PATCH / PUT | `If-None-Match` | * | check for _any_ version of the resource, if one is found, fail the operation | `412-Precondition Failed` | Response body SHOULD return the serialized value of the resource (typically JSON) that was passed along with the request.|
964968
| PATCH / PUT | `If-Match` | value of ETag | value of `If-Match` equals the latest ETag value on the server, confirming that the version of the resource is the most current | `200-OK` or </br> `201-Created` </br> | Response header MUST include the new `ETag` value. Response body SHOULD include the serialized value of the resource (typically JSON). |
965969
| PATCH / PUT | `If-Match` | value of ETag | value of `If-Match` header DOES NOT equal the latest ETag value on the server, indicating a change has ocurred since after the client fetched the resource| `412-Precondition Failed` | Response body SHOULD return the serialized value of the resource (typically JSON) that was passed along with the request.|
966-
| DELETE | `If-None-Match` | value of ETag | value does NOT match the latest value on the server | `412-Preconditioned Failed` | Response body SHOULD be empty.|
967-
| DELETE | `If-None-Match` | value of ETag | value matches the latest value on the server | `204-No Content` | Response body SHOULD be empty. |
970+
| DELETE | `If-Match` | value of ETag | value matches the latest value on the server | `204-No Content` | Response body SHOULD be empty. |
971+
| DELETE | `If-Match` | value of ETag | value does NOT match the latest value on the server | `412-Preconditioned Failed` | Response body SHOULD be empty.|
968972

969973
#### Computing ETags
970974
The strategy that you use to compute the `ETag` depends on its semantic. For example, it is natural, for resources that are inherently versioned, to use the version as the value of the `ETag`. Another common strategy for determining the value of an `ETag` is to use a hash of the resource. If a resource is not versioned, and unless computing a hash is prohibitively expensive, this is the preferred mechanism.

0 commit comments

Comments
 (0)