如何在管道中获取 Azure Logic App 出站 IP 地址

How to get Azure Logic App Outbound IP addresses in pipeline

我正在尝试通过 Azure SQL 服务器防火墙将 逻辑应用程序 列入白名单,在 Azure DevOps Pipeline 中,我需要获取它或它的连接器的 出站 IP 地址 ,对于 webapps 通常我使用这个 powershell 命令:

(Get-AzWebApp -ResourceGroup <group_name> -name <app_name>).OutboundIpAddresses

如何为逻辑应用程序/api 连接器实现相同的功能。我还了解到逻辑应用程序的 ips 每个区域都相同,是否有 powershell 命令来获取这些 ips 并避免硬编码?

请尝试这种方式:

$myLogicApp = Get-AzureRmResource -ResourceGroupName "<your-resourcegroup-name>" -ResourceType Microsoft.Logic/workflows -ResourceName "<your-logic-app-name>"

$myLogicApp.Properties.endpointsConfiguration.workflow.outgoingIpAddresses

$myLogicApp.Properties.endpointsConfiguration.connector.outgoingIpAddresses