/// <summary>
        /// Gets the Storage Helper object based on account name and account key.
        /// It reads the following from the configuration file
        /// BlobStorageEndpoint, QueueStorageEndpoint, TableStorageEndpoint
        /// </summary>
        /// <param name="accountName">Storage Account Name</param>
        /// <param name="accountKey">Storage Account Key</param>
        /// <returns></returns>
        public static WindowsAzureStorageHelper GetStorageHelper(string accountName, string accountKey)
        {
            if (!string.IsNullOrEmpty(accountName) && !string.IsNullOrEmpty(accountKey))
            {
                try
                {
                    string blobStorageEndPoint  = WindowsAzureSystemHelper.GetStringConfigurationValue("BlobStorageEndpoint");
                    string queueStorageEndpoint = WindowsAzureSystemHelper.GetStringConfigurationValue("QueueStorageEndpoint");
                    string tableStorageEndpoint = WindowsAzureSystemHelper.GetStringConfigurationValue("TableStorageEndpoint");

                    return(new WindowsAzureStorageHelper(
                               accountName,
                               accountKey, false,
                               blobStorageEndPoint,
                               queueStorageEndpoint,
                               tableStorageEndpoint));
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }//if

            return(null);
        }
示例#2
0
 public static string GetLogLevel()
 {
     try
     {
         return WindowsAzureSystemHelper.GetStringConfigurationValue("LogLevel").ToLower();
     }
     catch (Exception ex)
     {
         Trace.WriteLine(ex.Message, "Error");
     }
     return "Info";
 }