'How can I change the `Blob path begins with` in the Azure data factory storage event trigger using azure DevOps?
I have set a storage event trigger for the pipelines in the azure data factory Dev environment. the blob path begins with
is different in the dev environment and other environments (Staging and Production). I thought about parametrizing it, but it seems it is not possible to use dynamic content there. Does anyone know of a way to change it in the azure DevOps pipeline or in any other way?
Solution 1:[1]
Since it is not possible to parametrize blob path begins with
in the Azure data factory storage event trigger, I decided to modify the ARMTemplateForFactory.json
in the adf_publish
branch directly from the Azure DevOps pipeline using a PowerShell script. I am going to share my script here:
param(
[String] $ADFArmPath
)
$JsonData = (Get-Content $ADFArmPath -raw | ConvertFrom-Json)
$JsonData.update | % { if($JsonData.resources.properties)
{
foreach ($ItemName in $JsonData.resources.properties ) {
if($ItemName.type -eq "BlobEventsTrigger")
{
$ItemName.typeProperties.blobPathBeginsWith = $ItemName.typeProperties.blobPathBeginsWith.replace('x','y')
}
}
}
}
$JsonData | ConvertTo-Json -Depth 100 | set-content $ADFArmPath ```
Solution 2:[2]
It's not possible to parameterize blob path begins with
field in Storage event triggers at this moment. You need to create multiple triggers to achieve the requirement.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | soroush salehi |
Solution 2 | AnnuKumari-MSFT |