diff --git a/src/Azure.Functions.Cli/Actions/AzureActions/PublishFunctionAppAction.cs b/src/Azure.Functions.Cli/Actions/AzureActions/PublishFunctionAppAction.cs index 1124a8812..f48cfdad9 100644 --- a/src/Azure.Functions.Cli/Actions/AzureActions/PublishFunctionAppAction.cs +++ b/src/Azure.Functions.Cli/Actions/AzureActions/PublishFunctionAppAction.cs @@ -36,6 +36,7 @@ internal class PublishFunctionAppAction : BaseFunctionAppAction public bool ListIgnoredFiles { get; set; } public bool ListIncludedFiles { get; set; } public bool RunFromPackageDeploy { get; private set; } + public bool ShowKeys { get; set; } public bool Force { get; set; } public bool Csx { get; set; } public bool BuildNativeDeps { get; set; } @@ -94,6 +95,11 @@ public override ICommandLineParserResult ParseArgs(string[] args) .Setup("no-bundler") .WithDescription("[Deprecated] Skips generating a bundle when publishing python function apps with build-native-deps.") .Callback(nb => ColoredConsole.WriteLine(WarningColor($"Warning: Argument {AdditionalInfoColor("--no-bundler")} is deprecated and a no-op. Python function apps are not bundled anymore."))); + Parser + .Setup("show-keys") + .WithDescription("Adds function keys to the URLs displayed in the logs.") + .Callback(sk => ShowKeys = sk) + .SetDefault(false); Parser .Setup("additional-packages") .WithDescription("List of packages to install when building native dependencies. For example: \"python3-dev libevent-dev\"") @@ -492,7 +498,7 @@ private async Task PublishFunctionApp(Site functionApp, GitIgnoreParser ignorePa if (!(functionApp.IsLinux && functionApp.IsElasticPremium) && !(isFunctionAppDedicatedLinux && PublishBuildOption == BuildOption.Remote)) { - await AzureHelper.PrintFunctionsInfo(functionApp, AccessToken, ManagementURL, showKeys: true); + await AzureHelper.PrintFunctionsInfo(functionApp, AccessToken, ManagementURL, showKeys: ShowKeys); } } diff --git a/src/Azure.Functions.Cli/Helpers/AzureHelper.cs b/src/Azure.Functions.Cli/Helpers/AzureHelper.cs index d6f9f2226..aa4526b5f 100644 --- a/src/Azure.Functions.Cli/Helpers/AzureHelper.cs +++ b/src/Azure.Functions.Cli/Helpers/AzureHelper.cs @@ -391,7 +391,7 @@ public static async Task, string>> UpdateF } internal static async Task WaitUntilFunctionAppReadyAsync(Site functionApp, string accessToken, string managementURL, - bool showKeys, HttpMessageHandler messageHandler = null) + HttpMessageHandler messageHandler = null) { var masterKey = await GetMasterKeyAsync(functionApp.SiteId, accessToken, managementURL); @@ -457,7 +457,7 @@ public static async Task PrintFunctionsInfo(Site functionApp, string accessToken if (functionApp.IsKubeApp) { ColoredConsole.Write("Waiting for the functions host up and running "); - await WaitUntilFunctionAppReadyAsync(functionApp, accessToken, managementURL, showKeys); + await WaitUntilFunctionAppReadyAsync(functionApp, accessToken, managementURL); } ArmArrayWrapper functions = await GetFunctions(functionApp, accessToken, managementURL);