File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,13 @@ private void GetAzureInfo()
109109
110110 public static string GetDeviceName ( )
111111 {
112- var deviceName = Environment . MachineName ;
112+ var deviceName = Environment . GetEnvironmentVariable ( "STACKIFY_DEVICE_NAME" ) ;
113+ if ( ! String . IsNullOrEmpty ( deviceName ) )
114+ {
115+ return deviceName . Substring ( 0 , deviceName . Length > 60 ? 60 : deviceName . Length ) ;
116+ }
117+
118+ deviceName = Environment . MachineName ;
113119
114120 if ( AzureConfig . InAzure && ( ( AzureConfig . IsWebsite ) || ( AzureConfig . InAzure && Environment . MachineName . StartsWith ( "RD" ) ) ) )
115121 {
@@ -194,7 +200,13 @@ public static string GetEC2InstanceId()
194200#else
195201 public static string GetDeviceName ( )
196202 {
197- var deviceName = Environment . MachineName ;
203+ var deviceName = Environment . GetEnvironmentVariable ( "STACKIFY_DEVICE_NAME" ) ;
204+ if ( ! String . IsNullOrEmpty ( deviceName ) )
205+ {
206+ return deviceName . Substring ( 0 , deviceName . Length > 60 ? 60 : deviceName . Length ) ;
207+ }
208+
209+ deviceName = Environment . MachineName ;
198210
199211 if ( AzureConfig . InAzure && ( ( AzureConfig . IsWebsite ) || ( AzureConfig . InAzure && Environment . MachineName . StartsWith ( "RD" ) ) ) )
200212 {
You can’t perform that action at this time.
0 commit comments