views:

27

answers:

1

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.

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-caa4443e75cb
A: 

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"];

Would work

EDIT(for Storage Client Lib) ...

If you are using the Client library, you can get at ETag from the Properties collection on CloudBlob

So ..

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: http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.storageclient.blobproperties_members.aspx

Taylor
I'm using the Storage Client Library. Not sure if this is exposed, but I'll look
MakerOfThings7
check edit for eTag. I'll have to dig up how to get at request id. Storage Client just wraps the API so I'm sure its there, just haven't had to access it that way
Taylor
I don't see an etag for Azure Tables... I'm looking in the properties in the debugger. Maybe I'm not seeing it. Ideally I can simply get this value when an exception is thrown, or in a worse case I can store the value somewhere in case an exception is thrown.
MakerOfThings7
I just did a Fiddler trace against Azure Tables in the dev environment and don't see either header at all. Perhaps the Whitepaper is mistaken, or that debugging information doesn't apply to local development.
MakerOfThings7
x-ms-requestid is a tracking function of the storage API. It's prob not something they add to Dev Storage
Taylor

related questions