Skip to content

Commit

Permalink
Refactor WEBSITE_INSTANCE_ID (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanzhang Zeng (Roger) authored and sanchitmehta committed Jun 14, 2019
1 parent 3e0f397 commit e188011
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Kudu.Core/AllSafeLinuxLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private static void CreateLockInfoFile(string operationName)
var lockInfo = new LinuxLockInfo();
lockInfo.heldByPID = Process.GetCurrentProcess().Id;
lockInfo.heldByTID = Thread.CurrentThread.ManagedThreadId;
lockInfo.heldByWorker = System.Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");
lockInfo.heldByWorker = System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId);
lockInfo.heldByOp = operationName;
lockInfo.lockExpiry = DateTime.UtcNow.AddSeconds(lockTimeout);
//Console.WriteLine("CreatingLockDir - LockInfoObj : "+lockInfo);
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Core/Environment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ public bool IsOnLinuxConsumption

public static bool IsAzureEnvironment()
{
return !String.IsNullOrEmpty(System.Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID"));
return !String.IsNullOrEmpty(System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId));
}

public static bool SkipSslValidation
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Core/Helpers/PostDeploymentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private static string WebSiteElasticScaleEnabled
// WEBSITE_INSTANCE_ID not null or empty
public static bool IsAzureEnvironment()
{
return !String.IsNullOrEmpty(System.Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID"));
return !String.IsNullOrEmpty(System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId));
}

// WEBSITE_HOME_STAMPNAME = waws-prod-bay-001
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Core/Infrastructure/InstanceIdUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ private static void EnsureInstanceId()
return;
}

string instanceId = System.Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");
string instanceId = System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId);
if (String.IsNullOrEmpty(instanceId))
{
instanceId = System.Environment.MachineName;
Expand Down
2 changes: 1 addition & 1 deletion Kudu.Services.Web/Pages/NewUI/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</script>

@{
var workerIdHash = System.Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID");
var workerIdHash = System.Environment.GetEnvironmentVariable(Constants.AzureWebsiteInstanceId);
var workerIdShortHash = workerIdHash?.Substring(0, 12);
const string version = Constants.KuduBuild;
var showLearningBanner = !deploymentManager.GetResults().Any();
Expand Down

0 comments on commit e188011

Please sign in to comment.