I need to get DateTime during the deployment in a YAML file. The DateTime should be shown as
"startTime": "2017-12-08T00:00:00"
I found this help. but I need to follow the exact Datetime format. I wonder if anyone can help in this case?
-- Added --
I work on deploying Data Factory by YAML file. This StartTime will be DateTime for the trigger part of Data Factory pipeline
I have update my build pipeline with a variable, build.yml
variables:
deployDate: $(Get-Date -Format "YYYYMMDDThhmmssZ")
and inside my deploy.yml file
- task: AzureResourceGroupDeployment@2
displayName: "Deploy Azure Data Factory Content"
inputs:
azureSubscription: ...
action: ...
resourceGroupName: ..
location: ...
templateLocation: ...
csmFile: ...
csmParametersFile: ...
overrideParameters: >-
- ...
-triggerStartTime "$(deployDate)"
deploymentMode: 'Incremental'
and in adf.content.json, I added
"parameters": {
"triggerStartTime": {
"type": "string"
}
}
"name": "[concat(parameters('factoryName'), '/Trigger')]",
"type": "Microsoft.DataFactory/factories/triggers",
"apiVersion": "...",
"properties": {
"annotations": [],
"runtimeState": "Started",
"pipeline": {
"pipelineReference": {
"referenceName": "...",
"type": "PipelineReference"
},
"parameters": {}
},
"type": "TumblingWindowTrigger",
"typeProperties": {
"frequency": "Hour",
"interval": 1,
"startTime": "[parameters('triggerStartTime')]",
"delay": "00:00:00",
"maxConcurrency": 50,
"retryPolicy": {
"intervalInSeconds": 30
},
"dependsOn": []
}
},
"dependsOn": [
"[concat(variables('factoryId'), '/pipelines/...')]"
]