Пример #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;
            }
        }