Skip to content

Commit 71f8fb9

Browse files
cricaplaza-netreoTodd Lairt-lair
authored
Azure AppService Instance Name for IdentifyApp (#141)
* Updated Veracode SCA URL * RUI-1381 - Azure AppService, DeviceName * Pipeline Correction --------- Co-authored-by: Todd Lair <[email protected]> Co-authored-by: Todd Lair <[email protected]>
1 parent 9f682b7 commit 71f8fb9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Src/StackifyLib/Models/EnvironmentDetail.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@ public static EnvironmentDetail Get()
3333
/// </summary>
3434
private void GetAzureInfo()
3535
{
36+
//IsAzureWorkerRole is set when instantiating EnvironmentDetail
37+
//Useful in other parts directly referencing AzureInstanceName
38+
if(!IsAzureWorkerRole && AzureConfig.InAzure && AzureConfig.IsWebsite)
39+
{
40+
AzureInstanceName = AzureConfig.AzureInstanceName;
41+
42+
}
43+
3644
#if NETFULL
3745
if (registryAccessFailure)
3846
return;

Src/StackifyLib/Utils/HttpClient.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,12 @@ public bool IdentifyApp()
312312
env.ConfiguredEnvironmentName = Config.Environment;
313313
}
314314

315+
//Applicable only for Azure AppService
316+
if(AzureConfig.InAzure && AzureConfig.IsWebsite)
317+
{
318+
env.DeviceName = AzureConfig.AzureInstanceName;
319+
}
320+
315321
string jsonData = JsonConvert.SerializeObject(env, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore });
316322

317323
var response =

0 commit comments

Comments
 (0)