Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update data factory pipeline to FOCUS exports #571

Merged
merged 23 commits into from
Jun 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 138 additions & 6 deletions src/templates/finops-hub/modules/dataFactory.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -1673,14 +1673,131 @@ resource pipeline_ToIngestion 'Microsoft.DataFactory/factories/pipelines@2018-06
parent: dataFactory
properties: {
activities: [
{
// (start) -> Wait -> FolderArray -> Scope -> Metric -> Date -> File -> Folder -> Delete Target -> Convert CSV -> Delete CSV -> (end)
// Wait
{
name: 'Wait'
type: 'Wait'
dependsOn: []
userProperties: []
typeProperties: {
waitTimeInSeconds: 60
}
}
// Set FolderArray
{
name: 'Set FolderArray'
type: 'SetVariable'
dependsOn: [
{
activity: 'Wait'
dependencyConditions: [ 'Completed' ]
}
]
userProperties: []
typeProperties: {
variableName: 'folderArray'
value: {
value: '@split(pipeline().parameters.folderName, \'/\')'
type: 'Expression'
}
}
}
// Set FolderCount
{
name: 'Set FolderCount'
type: 'SetVariable'
dependsOn: [
{
activity: 'Set FolderArray'
dependencyConditions: [ 'Completed' ]
}
]
policy: {
secureOutput: false
secureInput: false
}
userProperties: []
typeProperties: {
variableName: 'folderCount'
value: '@length(split(pipeline().parameters.folderName, \'/\'))'
}
}
// Set SecondToLastFolder
{
name: 'Set SecondToLastFolder'
type: 'SetVariable'
dependsOn: [
{
activity: 'Set FolderCount'
dependencyConditions: [ 'Completed' ]
}
]
policy: {
secureOutput: false
secureInput: false
}
userProperties: []
typeProperties: {
variableName: 'secondToLastFolder'
value: '@variables(\'folderArray\')[sub(variables(\'folderCount\'), 2)]'
}
}
// Set ThirdToLastFolder
{
name: 'Set ThirdToLastFolder'
type: 'SetVariable'
dependsOn: [
{
activity: 'Set SecondToLastFolder'
dependencyConditions: [ 'Succeeded' ]
}
]
policy: {
secureOutput: false
secureInput: false
}
userProperties: []
typeProperties: {
variableName: 'thirdToLastFolder'
value: '@variables(\'folderArray\')[sub(variables(\'folderCount\'), 3)]'
}
}
// Set FourthToLastFolder
{
name: 'Set FourthToLastFolder'
type: 'SetVariable'
dependsOn: [
{
activity: 'Set ThirdToLastFolder'
dependencyConditions: [ 'Succeeded' ]
}
]
policy: {
secureOutput: false
secureInput: false
}
userProperties: []
typeProperties: {
variableName: 'fourthToLastFolder'
value: '@variables(\'folderArray\')[sub(variables(\'folderCount\'), 4)]'
}
}
// Set Scope
{
name: 'Set Scope'
type: 'SetVariable'
dependsOn: [
{
activity: 'Set FourthToLastFolder'
dependencyConditions: [ 'Completed' ]
}
]
userProperties: []
typeProperties: {
variableName: 'scope'
value: {
value: '@replace(split(pipeline().parameters.blobPath,split(pipeline().parameters.blobPath, \'/\')[sub(length(split(pipeline().parameters.blobPath, \'/\')), 4)])[0],\'${exportContainerName}\',\'${ingestionContainerName}\')'
value: '@replace(split(pipeline().parameters.folderName, if(greater(length(variables(\'secondToLastFolder\')), 12), variables(\'thirdToLastFolder\'), variables(\'fourthToLastFolder\')))[0], \'${exportContainerName}\', \'${ingestionContainerName}\')'
type: 'Expression'
}
}
Expand Down Expand Up @@ -1716,7 +1833,7 @@ resource pipeline_ToIngestion 'Microsoft.DataFactory/factories/pipelines@2018-06
typeProperties: {
variableName: 'date'
value: {
value: '@{substring(split(split(pipeline().parameters.blobPath, \'/\')[sub(length(split(pipeline().parameters.blobPath, \'/\')), 3)], \'-\')[0], 0, 4)}@{substring(split(split(pipeline().parameters.blobPath, \'/\')[sub(length(split(pipeline().parameters.blobPath, \'/\')), 3)], \'-\')[0], 4, 2)}'
value: '@{substring(if(greater(length(variables(\'secondToLastFolder\')), 12), variables(\'secondToLastFolder\'), variables(\'thirdToLastFolder\')), 0, 4)}@{substring(if(greater(length(variables(\'secondToLastFolder\')), 12), variables(\'secondToLastFolder\'), variables(\'thirdToLastFolder\')), 4, 2)}'
type: 'Expression'
}
}
Expand Down Expand Up @@ -1827,7 +1944,7 @@ resource pipeline_ToIngestion 'Microsoft.DataFactory/factories/pipelines@2018-06
typeProperties: {
variableName: 'detectedSchema'
value: {
value: 'focus'
value: 'focuscost'
flanakin marked this conversation as resolved.
Show resolved Hide resolved
type: 'Expression'
}
}
Expand Down Expand Up @@ -1947,7 +2064,7 @@ resource pipeline_ToIngestion 'Microsoft.DataFactory/factories/pipelines@2018-06
}
}
}
{
{
name: 'Delete Target'
type: 'Delete'
dependsOn: [
Expand Down Expand Up @@ -2115,7 +2232,22 @@ resource pipeline_ToIngestion 'Microsoft.DataFactory/factories/pipelines@2018-06
destinationFolder: {
type: 'String'
}
scope: {
folderArray: {
type: 'Array'
}
folderCount: {
type: 'Integer'
}
secondToLastFolder: {
type: 'String'
}
thirdToLastFolder: {
type: 'String'
}
fourthToLastFolder: {
type: 'String'
}
scope: {
type: 'String'
}
date: {
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.