The Azure table whitepaper mentions that the x-ms-request-id is useful to send to Microsoft in the event there is an error working with the data. If I do have such an error, I'd like my
try...catch block to take this and save it somewhere for future analysis.
In addition I need to extract the ETag value as well while in Table storage.
How do I extract this information and have it available when the Exception comes around?
HTTP/1.1 204 No Content Content-Length: 0 ETag: W/"datetime'2008-10-01T15%3A27%3A34.4838174Z'" x-ms-request-id: 7c1b5e22-831d-403c-b88a-caa4443e75cbAnswer1:
Depends on your client implementation, but they are all HTTP 1.1 headers.
For example, ( Assuming .NET WebRequest Class ) something like:
WebRequest request = WebRequest.Create("http://myazurestore.server.com"); .... WebResponse response = request.GetResponse(); string mSRequestId = response.Headers["x-ms-request-id"];
<em>EDIT(for Storage Client Lib) .</em>..
If you are using the Client library, you can get at ETag from the Properties collection on CloudBlob
Cloudblob blob = container.GetBlobReference("blobname.ext"); var eTag = blob.Properties.ETag
Properties is a blobProperties object. It should provide access to most of the needed data.
MSDN: <a href="http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storageclient.blobproperties_members.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storageclient.blobproperties_members.aspx</a>Answer2:
You may want to check out my open source Azure Table Storage Client project on CodePlex.
<a href="http://lucifurestash.codeplex.com/" rel="nofollow">Lucifure Stash</a> allows easy access to the ETag as well as the HttpWebRequest and HttpWebResponse objects.