From b3eb0887e4ba514b47b2bc12efbfee53c100b507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=B6tz=20Jensen?= Date: Mon, 6 Jan 2025 10:47:40 +0100 Subject: [PATCH] Fix: Storage.BlobOrFile will not work against Managed Identity backed API Connections --- PsLogicAppExtractor/internal/tasks/All/All.task.ps1 | 4 ++++ ...anagedApis.Storage.BlobOrFile.ListKey.AsArmObject.task.ps1 | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/PsLogicAppExtractor/internal/tasks/All/All.task.ps1 b/PsLogicAppExtractor/internal/tasks/All/All.task.ps1 index 8191a55..15f7453 100644 --- a/PsLogicAppExtractor/internal/tasks/All/All.task.ps1 +++ b/PsLogicAppExtractor/internal/tasks/All/All.task.ps1 @@ -2367,6 +2367,10 @@ Task -Name "Set-Arm.Connections.ManagedApis.Storage.BlobOrFile.ListKey.AsArmObje $armObj.resources[0].properties.parameters.'$connections'.value.PsObject.Properties | ForEach-Object { if ($_.Value.id -like "*managedApis/azureblob*" -or $_.Value.id -like "*managedApis/azurefile*") { + + # This should avoid Managed Identity based connections + if ($_.Value.connectionProperties.authentication.type -eq "ManagedServiceIdentity") { return } + $found = $true # Fetch the details from the connection object diff --git a/PsLogicAppExtractor/internal/tasks/Set-Arm.Connections.ManagedApis.Storage.BlobOrFile.ListKey.AsArmObject.task.ps1 b/PsLogicAppExtractor/internal/tasks/Set-Arm.Connections.ManagedApis.Storage.BlobOrFile.ListKey.AsArmObject.task.ps1 index 9b4650c..d6e0653 100644 --- a/PsLogicAppExtractor/internal/tasks/Set-Arm.Connections.ManagedApis.Storage.BlobOrFile.ListKey.AsArmObject.task.ps1 +++ b/PsLogicAppExtractor/internal/tasks/Set-Arm.Connections.ManagedApis.Storage.BlobOrFile.ListKey.AsArmObject.task.ps1 @@ -25,6 +25,10 @@ Task -Name "Set-Arm.Connections.ManagedApis.Storage.BlobOrFile.ListKey.AsArmObje $armObj.resources[0].properties.parameters.'$connections'.value.PsObject.Properties | ForEach-Object { if ($_.Value.id -like "*managedApis/azureblob*" -or $_.Value.id -like "*managedApis/azurefile*") { + + # This should avoid Managed Identity based connections + if ($_.Value.connectionProperties.authentication.type -eq "ManagedServiceIdentity") { return } + $found = $true # Fetch the details from the connection object