ADF Pipeline Error: This resource references resources which could not be loaded.

Soniran, Dare 0 Reputation points
2026-06-23T17:43:35.6533333+00:00

I have an existing data factory. Trying to create a CICD pipeline from adf_publish branch via ADO. (Aiming for it to auto run with each successful pull request. Failing to export and publish the artifact.

Error logs:

 BaseFileResourceProviderService: populateAllResources - downloaded git resources 
 BaseFileResourceProviderService: populateAllResources - loaded last version id 
 WARNING === BaseFileResourceProviderService: _processResource - Failed to load resource, loadingError: NameMismatch, Error: NameMismatch. 
 ModelService: fetchAllInBackground - start 
 ModelService: synchronize - finished 
 ModelService: _backgroundFetch - finished 
 ModelService: _backgroundFetch - finished, total unknown model types 
 CmdApiApp: Publishable resource count: 0 
 CmdApiApp: Publishable parameters count: 0 
 ERROR === CmdApiApp: Failed to export ARM template. Error: {"stack":"Error: No resource found in specified input path: /home/vsts/work/1/s/. Please set correct path and try again.\n    at Pb.<anonymous> (/home/vsts/work/1/s/downloads/main.js:2:16646763)\n    at Generator.next (<anonymous>)\n    at r (/home/vsts/work/1/s/downloads/main.js:2:14331810)","message":"No resource found in specified input path: /home/vsts/work/1/s/. Please set correct path and try again."} 
=====ERROR===== 
Error: Command failed: node  /home/vsts/work/1/s/downloads/main.js export /home/vsts/work/1/s/ 
/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.DataFactory/factories/<data-factory>
ARMTemplates  
Execution finished.... 
##[warning]Using unsupported node version: 18.20.8, use version 20.x or 22.x to avoid running into failures. 
##[warning]Couldn't find a debug log in the cache or working directory 
/home/vsts/work/1/s/node_modules/@microsoft/azure-data-factory-utilities/lib/bundle.manager.js:69 
                    throw "Execution failed with exit code: ".concat(exitCode); 
                    ^ 
Execution failed with exit code: 255 
(Use `node --trace-uncaught ...` to show where the exception was thrown) 
Node.js v18.20.8 
##[error]Error: Npm failed with return code: 1 
Finishing: Validate and Generate ARM template

root
├── adfcdc/.gitkeep
├── credntial/
├── dataflow/
├── dataset/
├── factory/
├── integrationRuntime/
├── linkedService/
├── managedVirtualNetwork/
├── pipeline/
├── trigger/
├── arm-template-parameters-definition.json
├── azure-pipelines-ci.yml
├──package.json
└── publish_config.json

File details:

  • package.json
      
      {
          "scripts":{
              "build":"node node_modules/@microsoft/azure-data-factory-utilities/lib/index"
          },
          "dependencies":{
              "@microsoft/azure-data-factory-utilities":"^1.0.3"
          }
      }
    
  • publish_config.json
      
      {"publishBranch":"factory/adf_publish","includeFactoryTemplate":false,"includeGlobalParamsTemplate":true}
    
  • azure-pipelines-ci.yml

The pipeline keeps failing at Export and Generate ARM template stage.

# Build pipeline: adf-publish-ci

trigger:
  - adf_publish

pool:
  vmImage: 'ubuntu-latest'

variables:
  adfId: '/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.DataFactory/factories/<data-factory>'
  buildArtifact: 'ARMTemplates'

stages:
- stage: BuildAndValidate
  jobs:
  - job: Build
    steps:
      - task: UseNode@1
        inputs:
          version: '18.x'
        displayName: 'Install Node.js'

      - task: Npm@1
        inputs:
          command: 'install'
          workingDir: '$(Build.Repository.LocalPath)/build' 
          verbose: true
        displayName: 'Install npm package'

      - task: Npm@1
        inputs:
          command: 'custom'
          workingDir: '$(Build.Repository.LocalPath)/build'
          customCommand: 'run build validate $(Build.Repository.LocalPath)/build $(adfId)'
        displayName: 'Validate'

      - task: Npm@1
        inputs:
          command: 'custom'
          workingDir: '$(Build.Repository.LocalPath)/build'
          customCommand: 'run build export $(Build.Repository.LocalPath)/build $(adfId) $(buildArtifact)'
        displayName: 'Export and Generate ARM template'
      
      - script: 'ls -r $(Build.Repository.LocalPath)/build'
        displayName: 'List Build Files'
      - task: PublishPipelineArtifact@1
        inputs:
          targetPath: '$(Build.Repository.LocalPath)/build/$(buildArtifact)' 
          artifact: '$(buildArtifact)'
          publishLocation: 'pipeline'
Azure Data Factory
Azure Data Factory

An Azure service for ingesting, preparing, and transforming data at scale.


2 answers

Sort by: Most helpful
  1. SAI JAGADEESH KUDIPUDI 3,550 Reputation points Microsoft External Staff Moderator
    2026-06-23T19:31:22.6033333+00:00

    Hi @Soniran, Dare ,

    Thank you for the detailed logs and pipeline configuration — that made it much easier to pinpoint what's happening.

    The export step is failing because the folder you pass to the utility does not contain the Data Factory source resources, so it finds nothing to publish:

    • Publishable resource count: 0
    • No resource found in specified input path: /home/vsts/work/1/s/

    In other words, the export command is pointed at a location that does not have the ADF resource JSONs (factory/, pipeline/, dataset/, linkedService/, etc.).

    There are two issues working together here:

    1. You are running CI against the adf_publish branch instead of the collaboration branch.

    The automated publish utility is designed to run against your collaboration branch, where the raw resource JSONs live. The adf_publish branch holds the already-generated ARM template, not the source model the export command expects. Running the utility against adf_publish (your trigger: - adf_publish and publishBranch: factory/adf_publish) is what produces the NameMismatch warning and Publishable resource count: 0.

    1. The input folder passed to export does not contain the resources.

    Your resources (factory/, pipeline/, dataset/, etc.) sit at the repo root, but the export task passes $(Build.Repository.LocalPath)/build as the root folder. Since /build only holds package.json, the utility sees an empty model and exports zero resources.

    Recommended fixes

    Point the CI pipeline trigger and checkout at the collaboration branch (the one holding the source resources), not adf_publish.

    Pass the correct resource folder as the export root. The command signature is: npm run build export <rootFolder> <factoryId> <outputFolder> The <rootFolder> must be the folder that actually contains factory/, pipeline/, dataset/, etc. — in your case the repo root, not /build. Keep package.json and npm install in /build, but set the export root to where the resources are.

    Upgrade Node to 20.x or 22.x. Node 18 is unsupported by the utility and can cause package-incompatibility failures. Update your UseNode@1 task accordingly.

    After the above, add an ls -r step on the exact folder being passed to export to confirm the resource JSONs are present before the export runs.

    Once the pipeline is pointed at the collaboration branch with the correct resource root and Node 20/22, the export will detect the resources and generate the ARM template successfully.

    References

    Hope this helps! If the issue still isn't resolved, could you please share the requested details in a private message so I can take a closer look? Please feel free to reach out with any follow-up questions — I'd be happy to help.

    Was this answer helpful?

    0 comments No comments

  2. AI answer

    2026-06-23T17:43:51.5166667+00:00

    The error message indicates that some referenced ADF resources cannot be resolved when the utilities try to export the ARM templates. From the provided configuration and the context, there are two common root causes to check in this scenario:

    1. Incorrect working path passed to the ADF utilities
      The ADF npm utilities expect the Data Factory root folder (the one that contains pipeline/, dataset/, linkedService/, etc.). In the official guidance, the customCommand includes the DataFactory folder in the path. In the context, a similar issue is described where the YAML is invalid because the package.json folder is used directly instead of the Data Factory folder:
         customCommand: 'run build validate $(Build.Repository.LocalPath) /subscriptions/.../factories/yourFactoryName'
      
      Resolution from the context:

      It should have DataFactory included in customCommand like 'run build validate $(Build.Repository.LocalPath)/DataFactory/subscriptions/.../factories/yourFactoryName'.

      In the current pipeline, the commands are:
         customCommand: 'run build validate $(Build.Repository.LocalPath)/build $(adfId)'
         customCommand: 'run build export $(Build.Repository.LocalPath)/build $(adfId) $(buildArtifact)'
      
      However, the ADF JSON folders (pipeline/, dataset/, etc.) are at the repo root, not under build/. So the first argument should point to the folder that contains those resource folders, not to build/. For example, if the structure is exactly as shown, change to:
         customCommand: 'run build validate $(Build.Repository.LocalPath) $(adfId)'
         customCommand: 'run build export $(Build.Repository.LocalPath) $(adfId) $(buildArtifact)'
      
      or, if all ADF artifacts are under a subfolder (for example DataFactory/), use that folder explicitly:
         customCommand: 'run build validate $(Build.Repository.LocalPath)/DataFactory $(adfId)'
         customCommand: 'run build export $(Build.Repository.LocalPath)/DataFactory $(adfId) $(buildArtifact)'
      
      This ensures the utilities can see all referenced resources and not fail with “This resource references resources which could not be loaded.”
    2. Trailing space or malformed Data Factory ID
      The context includes a case where validation/export using @microsoft/azure-data-factory-utilities failed only in CI because the Data Factory ID variable had an extra space when passed to the command. The resolution there was:

      The issue was caused by an extra space when passing the Data Factory ID as a variable to the GitHub Action. When we hardcoded the value and tested it, it worked correctly.

      In this pipeline, adfId is defined as:
         variables:
           adfId: '/subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.DataFactory/factories/<data-factory>'
      
      Actions:
      • Verify there is no leading/trailing space in the variable definition or when it is referenced.
      • As a test, hardcode the ID directly in the command:
             customCommand: 'run build export $(Build.Repository.LocalPath) /subscriptions/<sub>/resourceGroups/<rg>/providers/Microsoft.DataFactory/factories/<data-factory> $(buildArtifact)'
        
      • If this works while the variable-based version fails, adjust the variable definition (remove spaces, ensure correct quoting).

    After correcting the root folder argument and ensuring a clean adfId value, rerun the pipeline. The Export and Generate ARM template step should succeed and produce the ARMTemplates artifact under build/ARMTemplates (or the configured output path).


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.