public static string GetRoutingRequestId(this CloudException exception)
{
if (exception == null ||
exception.Response == null ||
exception.Response.Headers == null ||
!exception.Response.Headers.Keys.Contains("x-ms-routing-request-id"))
{
return null;
}
return exception.Response.Headers["x-ms-routing-request-id"].FirstOrDefault();
}
}