Skip to content

Commit

Permalink
Add telemetry on whether sas token is used in linked templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Weatherford committed Apr 15, 2021
1 parent b4a21e8 commit 41dddef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/documents/templates/linkedTemplates/linkedTemplates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export async function onRequestOpenLinkedFile(
openErrorType: string;
fileScheme: string;
hasQuery: string;
hasSas: string;
}>context.telemetry.properties;
properties.openErrorType = '';
properties.openResult = 'Error';
Expand All @@ -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';
Expand Down Expand Up @@ -250,6 +252,8 @@ export function assignTemplateGraphToDeploymentTemplate(
export async function openLinkedTemplateFileCommand(linkedTemplateUri: Uri, actionContext: IActionContext): Promise<void> {
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);
Expand Down

0 comments on commit 41dddef

Please sign in to comment.