diff --git a/src/commands/createFunctionApp/FunctionAppCreateStep.ts b/src/commands/createFunctionApp/FunctionAppCreateStep.ts index 20588db2a..713f2e9fc 100644 --- a/src/commands/createFunctionApp/FunctionAppCreateStep.ts +++ b/src/commands/createFunctionApp/FunctionAppCreateStep.ts @@ -7,7 +7,7 @@ import { type NameValuePair, type Site, type SiteConfig, type WebSiteManagementC import { BlobServiceClient } from '@azure/storage-blob'; import { ParsedSite, WebsiteOS, type CustomLocation, type IAppServiceWizardContext } from '@microsoft/vscode-azext-azureappservice'; import { LocationListStep } from '@microsoft/vscode-azext-azureutils'; -import { AzureWizardExecuteStep, parseError, randomUtils } from '@microsoft/vscode-azext-utils'; +import { AzureWizardExecuteStep, maskUserInfo, parseError, randomUtils } from '@microsoft/vscode-azext-utils'; import { type AppResource } from '@microsoft/vscode-azext-utils/hostapi'; import { type Progress } from 'vscode'; import { FuncVersion, getMajorVersion } from '../../FuncVersion'; @@ -53,7 +53,7 @@ export class FunctionAppCreateStep extends AzureWizardExecuteStepJSON.parse(backupStacks); - context.telemetry.properties.getStacksError = parseError(error).message; + context.telemetry.properties.getStacksError = maskUserInfo(parseError(error).message, []); } context._stacks = stacksArmResponse.value.map(d => d.properties); diff --git a/src/debug/validatePreDebug.ts b/src/debug/validatePreDebug.ts index c139d6663..9093a37eb 100644 --- a/src/debug/validatePreDebug.ts +++ b/src/debug/validatePreDebug.ts @@ -4,7 +4,7 @@ *--------------------------------------------------------------------------------------------*/ import { BlobServiceClient } from '@azure/storage-blob'; -import { AzExtFsExtra, parseError, type IActionContext } from "@microsoft/vscode-azext-utils"; +import { AzExtFsExtra, maskUserInfo, parseError, type IActionContext } from "@microsoft/vscode-azext-utils"; import * as path from 'path'; import * as semver from 'semver'; import * as vscode from 'vscode'; @@ -90,7 +90,7 @@ export async function preDebugValidate(actionContext: IActionContext, debugConfi } else { // Don't block debugging for "unexpected" errors. The func cli might still work shouldContinue = true; - context.telemetry.properties.preDebugValidateError = pe.message; + context.telemetry.properties.preDebugValidateError = maskUserInfo(pe.message, []); } } diff --git a/src/funcCoreTools/validateFuncCoreToolsIsLatest.ts b/src/funcCoreTools/validateFuncCoreToolsIsLatest.ts index dfff2ebcd..f7889b8ad 100644 --- a/src/funcCoreTools/validateFuncCoreToolsIsLatest.ts +++ b/src/funcCoreTools/validateFuncCoreToolsIsLatest.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { callWithTelemetryAndErrorHandling, DialogResponses, parseError, type IActionContext } from '@microsoft/vscode-azext-utils'; +import { callWithTelemetryAndErrorHandling, DialogResponses, maskUserInfo, parseError, type IActionContext } from '@microsoft/vscode-azext-utils'; import * as semver from 'semver'; import type * as vscode from 'vscode'; import { PackageManager } from '../constants'; @@ -120,7 +120,7 @@ async function getNewestFunctionRuntimeVersion(packageManager: PackageManager | return (await getNpmDistTag(context, versionFromSetting)).value; } } catch (error) { - context.telemetry.properties.latestRuntimeError = parseError(error).message; + context.telemetry.properties.latestRuntimeError = maskUserInfo(parseError(error).message, []); } return undefined; diff --git a/src/templates/CentralTemplateProvider.ts b/src/templates/CentralTemplateProvider.ts index 7850e27ed..ca5b1fa73 100644 --- a/src/templates/CentralTemplateProvider.ts +++ b/src/templates/CentralTemplateProvider.ts @@ -3,7 +3,7 @@ * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ -import { parseError, type IActionContext } from '@microsoft/vscode-azext-utils'; +import { maskUserInfo, parseError, type IActionContext } from '@microsoft/vscode-azext-utils'; import { Disposable, workspace, type ConfigurationChangeEvent } from 'vscode'; import { FuncVersion } from '../FuncVersion'; import { ProjectLanguage, TemplateFilter, projectTemplateKeySetting } from '../constants'; @@ -237,7 +237,7 @@ export class CentralTemplateProvider implements Disposable { // This error should be the most actionable to the user, so save it and throw later if cache/backup doesn't work latestErrorMessage = localize('latestTemplatesError', 'Failed to get latest templates: {0}', errorMessage); ext.outputChannel.appendLog(latestErrorMessage); - context.telemetry.properties.latestTemplatesError = errorMessage; + context.telemetry.properties.latestTemplatesError = maskUserInfo(errorMessage, []); } // 3. Use the cached templates, even if they don't match latestTemplateVersion @@ -293,7 +293,7 @@ export class CentralTemplateProvider implements Disposable { } catch (error) { const errorMessage: string = parseError(error).message; ext.outputChannel.appendLog(localize('cachedTemplatesError', 'Failed to get cached templates: {0}', errorMessage)); - context.telemetry.properties.cachedTemplatesError = errorMessage; + context.telemetry.properties.cachedTemplatesError = maskUserInfo(errorMessage, []); } } @@ -313,7 +313,7 @@ export class CentralTemplateProvider implements Disposable { } catch (error) { const errorMessage: string = parseError(error).message; ext.outputChannel.appendLog(localize('backupTemplatesError', 'Failed to get backup templates: {0}', errorMessage)); - context.telemetry.properties.backupTemplatesError = errorMessage; + context.telemetry.properties.backupTemplatesError = maskUserInfo(errorMessage, []); } }