WriteExceptionToBlobStorage() public static method

Logs exceptions to blob storage (useful for logging exceptions without delay before role crashes). See: http://weblogs.thinktecture.com/cweyer/2011/01/trying-to-troubleshoot-windows-azure-compute-role-startup-issues.html
public static WriteExceptionToBlobStorage ( Exception ex ) : void
ex System.Exception The exception to log to blob storage
return void
Beispiel #1
0
        private static bool CheckHasWebDeployLease()
        {
            try
            {
                return(CurrentRoleInstanceId() == WebDeployLeaseBlob().Metadata["InstanceId"]);
            }
            catch (Exception ex)
            {
                try
                {
                    DiagnosticsHelper.WriteExceptionToBlobStorage(ex);
                }
                catch (Exception) {}

                var master = CurrentRoleInstanceId().EndsWith("_0") || CurrentRoleInstanceId().EndsWith(".0");
                if (master)
                {
                    return(true);
                }

                throw;
            }
        }