Skip to content

Commit a3924ef

Browse files
committed
Using a stable instance ID
1 parent 8085c6d commit a3924ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/WebJobs.Script/Host/ScriptHost.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ public string InstanceId
5454
{
5555
if (_instanceId == null)
5656
{
57-
_instanceId = Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID") ?? Guid.NewGuid().ToString("N");
57+
_instanceId = Environment.GetEnvironmentVariable("WEBSITE_INSTANCE_ID")
58+
?? Environment.MachineName.GetHashCode().ToString("X").PadLeft(32, '0');
59+
5860
_instanceId = _instanceId.Substring(0, 32);
5961
}
6062

0 commit comments

Comments
 (0)