-
Notifications
You must be signed in to change notification settings - Fork 618
Open
Description
Bug: ARM Template generator produces circular dependsOn with “Default staging linked service”
Package: @microsoft/azure-data-factory-utilities
Package Version: 1.0.3
Node.js Version: v24.13.0
NPM Version: 11.6.2
OS: Azure Pipelines ubuntu-latest
Description
When using @microsoft/azure-data-factory-utilities to generate an ARM template, enabling the Default staging linked service in Azure Data Factory (Manage → Factory Settings) causes the generator to produce an invalid ARM template.
The factory resource in the generated ARM template includes a dependsOn referencing a child linked service, creating a circular dependency:
Microsoft.DataFactory/factories/linkedServicesis a child of the factory- The factory cannot depend on its own child resources
Disabling the staging linked service resolves the issue and generates a valid ARM template.
Steps to Reproduce
- In ADF, configure Default staging linked service in Manage → Factory Settings.
- Use
@microsoft/azure-data-factory-utilitiesto generate an ARM template.
# https://aka.ms/yaml
pool:
vmImage: 'ubuntu-latest'
variables:
- name: 'AzureSubscriptionID'
value: ''
- name: 'AzureResourceGroupName'
value: ''
- name: 'AzureDataFactoryName'
value: ''
- name: 'AzureDataFactorySubscriptionPath'
value: '/subscriptions/$(AzureSubscriptionID)/resourceGroups/$(AzureResourceGroupName)/providers/Microsoft.DataFactory/factories/$(AzureDataFactoryName)'
steps:
- checkout: self
- task: NodeTool@0
inputs:
versionSpec: '24.x'
displayName: 'Install Node.js'
- task: Npm@1
inputs:
command: 'install'
workingDir: '$(Build.SourcesDirectory)'
displayName: 'Install npm package @microsoft/azure-data-factory-utilities'
- task: Npm@1
inputs:
command: 'custom'
workingDir: '$(Build.SourcesDirectory)'
customCommand: 'run build validate $(Build.SourcesDirectory) $(AzureDataFactorySubscriptionPath)'
displayName: 'Validate'
- task: Npm@1
inputs:
command: 'custom'
workingDir: '$(Build.SourcesDirectory)'
customCommand: 'run build-preview export $(Build.SourcesDirectory) $(AzureDataFactorySubscriptionPath) $(Build.ArtifactStagingDirectory)'
displayName: 'Validate and Generate ARM template'
- task: PublishPipelineArtifact@1
inputs:
targetPath: '$(Build.ArtifactStagingDirectory)'
artifact: 'ArmTemplates'
publishLocation: 'pipeline'
- Inspect the factory resource in the ARM template. Example snippet:
{
"name": "[parameters('factoryName')]",
"type": "Microsoft.DataFactory/factories",
"apiVersion": "2018-06-01",
"properties": {
"globalParameters": { ... },
"globalConfigurations": { ... }
},
"dependsOn": [
"[concat(variables('factoryId'), '/linkedServices/AzureDataLakeStorage')]"
],
"location": "[parameters('dataFactory_location')]"
}- Deploying or validating this template with ARM fails due to the circular dependency.
- Remove the staging linked service from the factory configuration, regenerate → the
dependsOndisappears, and the template becomes valid.
Expected Behaviour
The factory resource should not include dependsOn on its child linked services, even if referenced in global configurations.
Workarounds
- Manually remove the
dependsOnfrom the factory resource in the generated template. - Avoid using the Default staging linked service setting until the bug is fixed.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels