Search code examples
resthttpazureazure-storagehttp-caching

Does Azure File Service REST API support the concept of conditional operations?


The documentation of Azure Files REST API lists some operations like GET File Metadata where response headers contain an ETag to serve this purpose

The ETag contains a value that you can use to perform operations conditionally, in quotes.

My modified requests with applied 'If-Modified-Since' header were responded by API with HTTP 403.

403 {'date': 'Wed, 05 Aug 2015 13:36:57 GMT', 'content-length': '729', 'content-type': 'application/xml', 'x-ms-request-id': '3cdf88a2-001a-003f-4083-cf9725000000', 'server': 'Microsoft-HTTPAPI/2.0'}

These were the request headers

{'x-ms-version': '2014-02-14', 'Accept-Encoding': 'gzip, deflate', 'Accept': '/', 'User-Agent': 'python-requests/2.5.1 CPython/2.7.6 Linux/3.13.0-61-generic', 'Connection': 'keep-alive', 'If-Modified-Since': 'Tue, 04 Aug 2015 13:36:58 GMT', 'Authorization': 'SharedKey storage_account:secret_key', 'x-ms-date': 'Wed, 05 Aug 2015 13:36:58 GMT'}

Summary: The Azure Files REST API indicated no support for conditional operation, but permitted them. I did not find anything noteable in the documentation of Azure Files REST API.

The documentation for Azure Blob Service contains a section how to apply conditional headers.

Several Blob service operations support the use of conditional headers. You can specify conditional headers to carry out an operation only if a specified condition has been met.

The Blob service follows the HTTP/1.1 protocol specification for conditional headers.

Does Azure File Service REST API support a similar concept of conditional operations?


Solution

  • I have gone through the REST API documentation and as far as I can see, I can say that conditional operations are not supported in File Service in the current version of REST API. They may support it in future version though.