@microsoft/azure-data-factory-utilities fails to download script from internet in securized private build agent

Jean-Christophe Gauvreau 20 Reputation points
2024-01-08T14:34:35.11+00:00

In this link (https://www.npmjs.com/package/@microsoft/azure-data-factory-utilities?activeTab=readme) it has been mentioned that the package @microsoft/azure-data-factory-utilities downloads a JavaScript (https://adf.azure.com/assets/cmd-api/main.js) from internet. In a secured work environment, it is not allowed to download bundles from Internet into private build agents.

Therefore, is it possible to add the dependencies into the same package @microsoft/azure-data-factory-utilities so that we can validate and export without download the main.js file from internet in private build agents.

I am successfull validating and exporting locally, but it doesn't work from the build agent.

Also, this issue is related : https://github.com/azure/azure-datafactory/issues/635

Azure Data Factory
Azure Data Factory

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

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

Answer accepted by question author
Anonymous
2024-01-11T04:49:37.3666667+00:00

@Jean-Christophe Gauvreau
Welcome to Microsoft Q&A platform and thanks for posting your question.

I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others "I'll repost your solution in case you'd like to accept the answer.

Ask: is it possible to add the dependencies into the same package @microsoft/azure-data-factory-utilities so that we can validate and export without download the main.js file from internet in private build agents?

I am successful validating and exporting locally, but it doesn't work from the build agent.

Solution: 2 possible solutions:

1 - Download the script manually, upload it to our internal artifact directory, then download the artifact to the agent from the internal artifact directory.

2 - Open/whitelist the communication to this specific webpage from the private agent https://adf.azure.com/assets/cmd-api/main.js

If I missed anything please let me know and I'd be happy to add it to my answer, or feel free to comment below with any additional information.

If you have any other questions, please let me know. Thank you again for your time and patience throughout this issue.

Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

Was this answer helpful?

3 additional answers

Sort by: Most helpful
  1. Bánhidy Attila 20 Reputation points
    2026-08-25T13:12:48.16+00:00

    ...to be honest, the main question would be: how can I solve, without any patch or packgae related file modification, that process not try to download main.js file, instead use mine downloaded main.js file...
    If I added --path flag to npm run build (or start) command after it, tried to download the main.js file...what is not possible...

    Was this answer helpful?

    0 comments No comments
  2. Bánhidy Attila 20 Reputation points
    2026-08-25T12:58:41.51+00:00

    Hi,

    I'm not sure whether this issue is still active, but I'm currently fighting a very similar problem.

    My company's network is highly restricted, so the pipeline is not able to download the main.js file.

    What I did:

    Downloaded the file manually from: https://adf.azure.com/assets/cmd-api/main.js

    Added it to the pipeline repository.

    My package.json looks like this because I can only download the utility package from our Nexus repository:

    {
     "scripts": {
     "build": "node node_modules/@microsoft/azure-data-factory-utilities/lib/index"
     },
     "dependencies": {
     "@microsoft/azure-data-factory-utilities": "^1.0.0"
     }
    }
    

    The installed version is 1.0.3.

    So the utility package is installed locally, not globally.

    I also patched bundle.manager.js:

    set -euo pipefail
    
    BUNDLE_FILE="$(Build.SourcesDirectory)/node_modules/@microsoft/azure-data-factory-utilities/lib/bundle.manager.js"
    
    sed -i "s|if (!fs.existsSync(BundleManager.defaultBundleDir)) {|this._runCommand('$(Build.SourcesDirectory)/_scripts/AdfPublishTool/main.js', args); return;\\
    if (!fs.existsSync(BundleManager.defaultBundleDir)) {|g" "$BUNDLE_FILE"
    
    grep -n "_scripts/AdfPublishTool/main.js" "$BUNDLE_FILE"
    
    

    I also tried using the --path option to specify the location of my downloaded main.js file. However, when using --path, the process still attempts to download main.js, which is not possible in our environment.

    At this point I am quite confused about what the correct solution should be. I have already spent several days trying to solve this issue, but I still have not managed to get it working.

    If you need any additional information and it is not sensitive, I will gladly provide it.

    Any help would be greatly appreciated.

    Thanks!

    Was this answer helpful?

  3. Jean-Christophe Gauvreau 20 Reputation points
    2024-01-10T21:23:11.5866667+00:00

    2 possible solutions :

    1 - Download the script manually, upload it to our internal artifact directory, then download the artifact to the agent from the internal artifact directory.

    2 - Open/whitelist the communication to this specific webpage from the private agent https://adf.azure.com/assets/cmd-api/main.js

    Was this answer helpful?