[英]Azure Data factory pipeline and dependent triggers
我正在尝试列出我的所有 ADF 管道及其相关触发器。 根据这篇文章https://learn.microsoft.com/en-us/rest/api/datafactory/triggers/get有一个简单的 GET 方法,它将列出所有触发器及其关联的管道。 当我在 ADF 管道中使用 web 活动和 GET 方法时,这工作正常。 我正在尝试使用 powershell 执行相同的操作。在 ADF output 中可见的管道名称在通过 powershell 运行时不再可见。
有人可以用下面的代码帮助我确定在执行此 GET 方法时需要添加什么来获取触发器的依赖管道名称。 任何其他方法也将受到高度赞赏。
Connect-AzAccount -Identity
$azContext = Get-AzContext
$azProfile = [Microsoft.Azure.Commands.Common.Authentication.Abstractions.AzureRmProfileProvider]::Instance.Profile
$profileClient = New-Object -TypeName Microsoft.Azure.Commands.ResourceManager.Common.RMProfileClient -ArgumentList ($azProfile)
$token = $profileClient.AcquireAccessToken($azContext.Subscription.TenantId)
$authHeader = @{
'Content-Type'='application/json'
'Authorization'='Bearer ' + $token.AccessToken
}
$restUri = 'https://management.azure.com/subscriptions/1111111-1111-1111-11111-1111111/resourceGroups/resourceGroupName/providers/Microsoft.DataFactory/factories/DataFactoryName/triggers?api-version=2018-06-01'
$response = Invoke-RestMethod -Method GET -Header $authHeader -URI $restUri
$response | ConvertTo-Json
Powershell Output - 使用 powershell 5.1 通过 Azure 运行手册
"value": [
{
"id": "/subscriptions/1234-1234-1234-1234/resourceGroups/ResourceGroupName/providers/Microsoft.DataFactory/factories/DataFactoryName/triggers/eventbasedtrigger",
"name": "eventbasedtrigger",
"type": "Microsoft.DataFactory/factories/triggers",
"properties": "@{description=Tets Trigger; annotations=System.Object[]; runtimeState=Stopped; pipelines=System.Object[]; type=BlobEventsTrigger; typeProperties=}",
"etag": "000000-0000-0d00-0000-0000000"
},
干杯
Powershell 命令 Get-AzDataFactoryV2Trigger 将为您提供 ADF 管道/数据工厂的触发器列表
获取 AzDataFactoryV2Trigger -ResourceGroupName“<RG_NAME>”-DataFactoryName“<ADF_NAME>”
获取 AzDataFactoryV2Trigger -ResourceGroupName“<RG_NAME>”-DataFactoryName“<ADF_NAME>”-TriggerName“<TRIGGER_NAME>”
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.