I have deployed data factory instances via yaml pipelines and multiline overrideParameters successfully in the past but it seems that the Azure DevOps parser does not like keys that have spaces in them and fails with error There was an error while overriding [my-parameter] parameter because of 'TypeError: Cannot read property 'type' of undefined', make sure it follows JavaScript Object Notation (JSON).
The parameter name is automatically created via adf_publish branch so I cannot change it (I don't want to use custom templates if that is an option). Here is some sample setup and what I have tried.
adf_publish arm parameter file
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"factoryName": {
"value": "my_adf"
},
"AAS-Shutdown-Trigger_properties_AAS Shutdown_parameters_AASServerName": {
"value": "my_aas_server"
}
}
}
pipeline.yml
- task: AzureResourceManagerTemplateDeployment@3
displayName: 'ARM Template deployment'
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: ${{ variables.azureSubscription }}
subscriptionId: ${{ variables.subscriptionId }}
action: 'Create Or Update Resource Group'
resourceGroupName: ${{ variables.resourceGroupName }}
location: 'West Europe'
templateLocation: 'Linked artifact'
csmFile: '$(System.DefaultWorkingDirectory)/adf_branch/${{ variables.dataFactoryRepoPath }}/ARMTemplateForFactory.json'
csmParametersFile: '$(System.DefaultWorkingDirectory)/adf_branch/${{ variables.dataFactoryRepoPath }}/ARMTemplateParametersForFactory.json'
overrideParameters: >-
-factoryName "${{ variables.dataFactoryName }}"
-AAS-Shutdown-Trigger_properties_AAS Shutdown_parameters_AASServerName "${{ variables.aasShutdownServer }}"
deploymentMode: 'Incremental'
I have tried the following variants on the parameter key (nothing worked)
- -AAS-Shutdown-Trigger_properties_AAS Shutdown_parameters_AASServerName
- -"AAS-Shutdown-Trigger_properties_AAS Shutdown_parameters_AASServerName"
- -'AAS-Shutdown-Trigger_properties_AAS Shutdown_parameters_AASServerName'
- -["AAS-Shutdown-Trigger_properties_AAS Shutdown_parameters_AASServerName"]
- -['AAS-Shutdown-Trigger_properties_AAS Shutdown_parameters_AASServerName']
If I remove the parameter in question, all works fine.
EDIT: Adding the adf resource definition of the trigger in question (as requested by @KamilNowinski
{
"name": "AAS-Shutdown-Trigger",
"properties": {
"annotations": [],
"runtimeState": "Started",
"pipelines": [
{
"pipelineReference": {
"referenceName": "AAS Shutdown",
"type": "PipelineReference"
},
"parameters": {
"AASServerName": "my-aas",
"ResourceGroupName": "my-rg",
"EtlPipelineName": "ETL Pipeline",
"KeyVaultName": "my-kv",
"OMSIdSecretName": "OMS-Workspace-ID",
"OMSKeySecretName": "OMS-Workspace-Key",
"AutomationAccountName": "my-atm",
"RunbookName": "aas-runbook"
}
}
],
"type": "ScheduleTrigger",
"typeProperties": {
"recurrence": {
"frequency": "Minute",
"interval": 10,
"startTime": "2020-10-07T13:27:00Z",
"timeZone": "UTC"
}
}
}
}