From 87955fbd9aa851ea30f82d083b2d4b180d0d5bba Mon Sep 17 00:00:00 2001 From: KobeLenjou Date: Fri, 27 May 2022 16:34:13 +0200 Subject: [PATCH] Fix for anonymous access --- .../.pipelines/scripts/Generate-Connections.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-devops-sample/.pipelines/scripts/Generate-Connections.ps1 b/azure-devops-sample/.pipelines/scripts/Generate-Connections.ps1 index 50902ef..b82d94a 100644 --- a/azure-devops-sample/.pipelines/scripts/Generate-Connections.ps1 +++ b/azure-devops-sample/.pipelines/scripts/Generate-Connections.ps1 @@ -92,6 +92,10 @@ Function Get-FunctionConnections { if ($function -match "(Invoke url)") { $function | select-string -Pattern "Invoke url:" -SimpleMatch | ForEach-Object { + # Anonymous functions do not have the ?code=xxx suffix + if (-not($line.contains('code'))) { + $line += '?' + } $line = $_.Line -replace '\s', '' $name = [Regex]::Matches($line, "(?<=api\/)(.*)(?=\?)") $trigger = [Regex]::Matches($line, "(?<=url:)(.*)(?=\?)")