From 41dddef5e4f91a3ce2c4b2c1d3da737ac551a93a Mon Sep 17 00:00:00 2001 From: Stephen Weatherford Date: Thu, 15 Apr 2021 16:39:13 -0700 Subject: [PATCH 1/2] Add telemetry on whether sas token is used in linked templates --- src/documents/templates/linkedTemplates/linkedTemplates.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/documents/templates/linkedTemplates/linkedTemplates.ts b/src/documents/templates/linkedTemplates/linkedTemplates.ts index 5f738a3c8..92605132a 100644 --- a/src/documents/templates/linkedTemplates/linkedTemplates.ts +++ b/src/documents/templates/linkedTemplates/linkedTemplates.ts @@ -89,6 +89,7 @@ export async function onRequestOpenLinkedFile( openErrorType: string; fileScheme: string; hasQuery: string; + hasSas: string; }>context.telemetry.properties; properties.openErrorType = ''; properties.openResult = 'Error'; @@ -102,6 +103,7 @@ export async function onRequestOpenLinkedFile( properties.fileScheme = requestedLinkUri.scheme; properties.hasQuery = String(!!requestedLinkUri.query); + properties.uriHasSas = String(!!requestedLinkUri.query.match('[&?]sig=')); if (requestedLinkUri.scheme === documentSchemes.untitled) { properties.openErrorType = 'template not saved'; @@ -250,6 +252,8 @@ export function assignTemplateGraphToDeploymentTemplate( export async function openLinkedTemplateFileCommand(linkedTemplateUri: Uri, actionContext: IActionContext): Promise { let targetUri: Uri; actionContext.telemetry.properties.scheme = linkedTemplateUri.scheme; + actionContext.telemetry.properties.uriHasQuery = String(!!linkedTemplateUri.query); + actionContext.telemetry.properties.uriHasSas = String(!!linkedTemplateUri.query.match('[&?]sig=')); if (linkedTemplateUri.scheme === documentSchemes.file) { const exists = await pathExists(linkedTemplateUri); From 49ae13d433c4ddd09652a3f8442ea5a1b4fc5aeb Mon Sep 17 00:00:00 2001 From: Stephen Weatherford Date: Thu, 15 Apr 2021 16:41:43 -0700 Subject: [PATCH 2/2] fix --- src/documents/templates/linkedTemplates/linkedTemplates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/documents/templates/linkedTemplates/linkedTemplates.ts b/src/documents/templates/linkedTemplates/linkedTemplates.ts index 92605132a..624d424a4 100644 --- a/src/documents/templates/linkedTemplates/linkedTemplates.ts +++ b/src/documents/templates/linkedTemplates/linkedTemplates.ts @@ -89,7 +89,7 @@ export async function onRequestOpenLinkedFile( openErrorType: string; fileScheme: string; hasQuery: string; - hasSas: string; + uriHasSas: string; }>context.telemetry.properties; properties.openErrorType = ''; properties.openResult = 'Error';