|
2 | 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. |
3 | 3 |
|
4 | 4 | using System.Collections.ObjectModel; |
5 | | -using System.Reflection; |
| 5 | +using Azure.Functions.Cli.Extensions; |
6 | 6 | using Azure.Functions.Cli.Helpers; |
7 | 7 |
|
8 | 8 | namespace Azure.Functions.Cli.Common |
9 | 9 | { |
10 | | - internal static class Constants |
| 10 | + internal static partial class Constants |
11 | 11 | { |
12 | 12 | public const string StorageConnectionStringTemplate = "DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}"; |
13 | 13 | public const string FunctionsStorageAccountNamePrefix = "AzureFunctions"; |
@@ -46,7 +46,6 @@ internal static class Constants |
46 | 46 | public const string FunctionsCoreToolsEnvironment = "FUNCTIONS_CORETOOLS_ENVIRONMENT"; |
47 | 47 | public const string EnablePersistenceChannelDebugSetting = "FUNCTIONS_CORE_TOOLS_ENABLE_PERSISTENCE_CHANNEL_DEBUG_OUTPUT"; |
48 | 48 | public const string TelemetryOptOutVariable = "FUNCTIONS_CORE_TOOLS_TELEMETRY_OPTOUT"; |
49 | | - public const string TelemetryInstrumentationKey = "00000000-0000-0000-0000-000000000000"; |
50 | 49 | public const string ScmRunFromPackage = "SCM_RUN_FROM_PACKAGE"; |
51 | 50 | public const string ScmDoBuildDuringDeployment = "SCM_DO_BUILD_DURING_DEPLOYMENT"; |
52 | 51 | public const string WebsiteRunFromPackage = "WEBSITE_RUN_FROM_PACKAGE"; |
@@ -120,12 +119,11 @@ internal static class Constants |
120 | 119 | "entityTrigger", |
121 | 120 | ]; |
122 | 121 |
|
123 | | -#pragma warning disable SA1401 // Fields should be private |
124 | | - public static string CliDetailedVersion = typeof(Constants).Assembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion ?? string.Empty; |
125 | | - public static string CliUserAgent = $"functions-core-tools/{CliVersion}"; |
126 | | -#pragma warning restore SA1401 // Fields should be private |
| 122 | + public static string CliVersion => typeof(Constants).Assembly.GetCliVersion(); |
127 | 123 |
|
128 | | - public static string CliVersion => typeof(Constants).GetTypeInfo().Assembly.GetName().Version.ToString(3); |
| 124 | + public static string CliDetailedVersion => typeof(Constants).Assembly.GetInformationalVersion(); |
| 125 | + |
| 126 | + public static string CliUserAgent => $"functions-core-tools/{CliVersion}"; |
129 | 127 |
|
130 | 128 | public static ExtensionPackage ExtensionsMetadataGeneratorPackage => new ExtensionPackage { Name = "Microsoft.Azure.WebJobs.Script.ExtensionsMetadataGenerator" }; |
131 | 129 |
|
|
0 commit comments