首页 > 解决方案 > 如何在管道中获取 Azure Logic App 出站 IP 地址

问题描述

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

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

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

标签: azure-logic-appsazure-powershellpowershell-4.0

解决方案


请尝试这种方式:

$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

推荐阅读