diff --git a/sdk/core/Azure.Core/src/DiagnosticsOptions.cs b/sdk/core/Azure.Core/src/DiagnosticsOptions.cs index 72dd193111c9b..714e82b40f862 100644 --- a/sdk/core/Azure.Core/src/DiagnosticsOptions.cs +++ b/sdk/core/Azure.Core/src/DiagnosticsOptions.cs @@ -110,13 +110,13 @@ public string? ApplicationId private static bool? EnvironmentVariableToBool(string? value) { - if (string.Equals("true", value, StringComparison.OrdinalIgnoreCase) || + if (string.Equals(bool.TrueString, value, StringComparison.OrdinalIgnoreCase) || string.Equals("1", value, StringComparison.OrdinalIgnoreCase)) { return true; } - if (string.Equals("false", value, StringComparison.OrdinalIgnoreCase) || + if (string.Equals(bool.FalseString, value, StringComparison.OrdinalIgnoreCase) || string.Equals("0", value, StringComparison.OrdinalIgnoreCase)) { return false;