Skip to content

Commit 7359a64

Browse files
committed
Updated to the new recommended way to fetch configuration settings
1 parent b933b51 commit 7359a64

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

AzureWebFarm/Helpers/AzureRoleEnvironment.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
using System.Configuration;
33
using System.IO;
44
using System.Net;
5+
using Microsoft.WindowsAzure;
56
using Microsoft.WindowsAzure.ServiceRuntime;
67
using Microsoft.WindowsAzure.Storage;
78
using Microsoft.WindowsAzure.Storage.Blob;
@@ -13,7 +14,7 @@ public static class AzureRoleEnvironment
1314
public static Func<bool> IsAvailable = () => RoleEnvironment.IsAvailable;
1415
public static Func<string> DeploymentId = () => IsAvailable() ? RoleEnvironment.DeploymentId : "NotInAzureEnvironment";
1516
public static Func<string> CurrentRoleInstanceId = () => IsAvailable() ? RoleEnvironment.CurrentRoleInstance.Id : Environment.MachineName;
16-
public static Func<string, string> GetConfigurationSettingValue = key => IsAvailable() ? RoleEnvironment.GetConfigurationSettingValue(key) : ConfigurationManager.AppSettings[key];
17+
public static Func<string, string> GetConfigurationSettingValue = key => CloudConfigurationManager.GetSetting(key);
1718
public static Func<string> RoleWebsiteName = () => IsAvailable() ? CurrentRoleInstanceId() + "_" + "Web" : "Default Web Site";
1819
public static Func<bool> IsComputeEmulatorEnvironment = () => IsAvailable() && DeploymentId().StartsWith("deployment", StringComparison.OrdinalIgnoreCase);
1920
public static Func<bool> IsEmulated = () => IsAvailable() && RoleEnvironment.IsEmulated;

0 commit comments

Comments
 (0)