@@ -60,29 +60,35 @@ internal static ManagedIdentitySource GetManagedIdentitySource(ILoggerAdapter lo
60
60
string msiEndpoint = EnvironmentVariables . MsiEndpoint ;
61
61
string msiSecretMachineLearning = EnvironmentVariables . MsiSecret ;
62
62
string imdsEndpoint = EnvironmentVariables . ImdsEndpoint ;
63
- string podIdentityEndpoint = EnvironmentVariables . PodIdentityEndpoint ;
63
+
64
+ logger ? . Info ( "[Managed Identity] Detecting managed identity source..." ) ;
64
65
65
66
if ( ! string . IsNullOrEmpty ( identityEndpoint ) && ! string . IsNullOrEmpty ( identityHeader ) )
66
67
{
67
68
if ( ! string . IsNullOrEmpty ( identityServerThumbprint ) )
68
69
{
70
+ logger ? . Info ( "[Managed Identity] Service Fabric detected." ) ;
69
71
return ManagedIdentitySource . ServiceFabric ;
70
72
}
71
73
else
72
74
{
75
+ logger ? . Info ( "[Managed Identity] App Service detected." ) ;
73
76
return ManagedIdentitySource . AppService ;
74
77
}
75
78
}
76
79
else if ( ! string . IsNullOrEmpty ( msiSecretMachineLearning ) && ! string . IsNullOrEmpty ( msiEndpoint ) )
77
80
{
81
+ logger ? . Info ( "[Managed Identity] Machine Learning detected." ) ;
78
82
return ManagedIdentitySource . MachineLearning ;
79
83
}
80
84
else if ( ! string . IsNullOrEmpty ( msiEndpoint ) )
81
85
{
86
+ logger ? . Info ( "[Managed Identity] Cloud Shell detected." ) ;
82
87
return ManagedIdentitySource . CloudShell ;
83
88
}
84
89
else if ( ValidateAzureArcEnvironment ( identityEndpoint , imdsEndpoint , logger ) )
85
90
{
91
+ logger ? . Info ( "[Managed Identity] Azure Arc detected." ) ;
86
92
return ManagedIdentitySource . AzureArc ;
87
93
}
88
94
else
@@ -94,6 +100,9 @@ internal static ManagedIdentitySource GetManagedIdentitySource(ILoggerAdapter lo
94
100
// Method to return true if a file exists and is not empty to validate the Azure arc environment.
95
101
private static bool ValidateAzureArcEnvironment ( string identityEndpoint , string imdsEndpoint , ILoggerAdapter logger )
96
102
{
103
+ logger ? . Info ( "[Managed Identity] Checked for sources: Service Fabric, App Service, Machine Learning, and Cloud Shell. " +
104
+ "They are not available." ) ;
105
+
97
106
if ( ! string . IsNullOrEmpty ( identityEndpoint ) && ! string . IsNullOrEmpty ( imdsEndpoint ) )
98
107
{
99
108
logger ? . Verbose ( ( ) => "[Managed Identity] Azure Arc managed identity is available through environment variables." ) ;
@@ -110,10 +119,6 @@ private static bool ValidateAzureArcEnvironment(string identityEndpoint, string
110
119
logger ? . Verbose ( ( ) => "[Managed Identity] Azure Arc managed identity is available through file detection." ) ;
111
120
return true ;
112
121
}
113
- else
114
- {
115
- logger ? . Warning ( "[Managed Identity] Azure Arc managed identity cannot be configured on a platform other than Windows and Linux." ) ;
116
- }
117
122
118
123
logger ? . Verbose ( ( ) => "[Managed Identity] Azure Arc managed identity is not available." ) ;
119
124
return false ;
0 commit comments