Skip to content
Prev Previous commit
Next Next commit
RUI-1381 - Azure AppService, DeviceName
  • Loading branch information
cricaplaza-netreo committed May 25, 2023
commit e27e526c934c6ef1631ca556dd87279aa1ea3933
8 changes: 8 additions & 0 deletions Src/StackifyLib/Models/EnvironmentDetail.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ public static EnvironmentDetail Get()
/// </summary>
private void GetAzureInfo()
{
//IsAzureWorkerRole is set when instantiating EnvironmentDetail
//Useful in other parts directly referencing AzureInstanceName
if(!IsAzureWorkerRole && AzureConfig.InAzure && AzureConfig.IsWebsite)
{
AzureInstanceName = AzureConfig.AzureInstanceName;

}

#if NETFULL
if (registryAccessFailure)
return;
Expand Down
6 changes: 6 additions & 0 deletions Src/StackifyLib/Utils/HttpClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ public bool IdentifyApp()
env.ConfiguredEnvironmentName = Config.Environment;
}

//Applicable only for Azure AppService
if(AzureConfig.InAzure && AzureConfig.IsWebsite)
{
env.DeviceName = AzureConfig.AzureInstanceName;
}

string jsonData = JsonConvert.SerializeObject(env, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });

var response =
Expand Down