Forum Discussion

rajm00's avatar
rajm00
Regular Visitor
8 months ago

Copy Job item appears to hardcode database name resulting in issues after CI/CD deployment

We have a Copy Job item that uses an on-prem SQL Server as its source. The connection has been parameterized. When deployed to the prod workspace, the source activity is expecting the same database name as the one being used in the lower environment. There does not appear to be a mechanim to either alter the database name or parameterize the database name.

6 Replies

  • You're running into a current limitation of Fabric Copy Job: while you can bind the connection object to a Variable Library (and thus change servers/credentials across environments), the database name in the Copy Job’s SQL source is not parameterizable—it remains a hard‑coded string in the job definition. That’s why, when you deploy to Prod, the source still points to the Dev database name. This behavior has been reported by others and documented with JSON snippets showing the connection variable is respected but the database property stays literal.
     
    One workaround is: 

    Use a Pipeline → Copy activity instead of Copy Job, and parameterize inside the activity

    Pipelines give you more knobs than Copy Jobs. For SQL sources in a Copy activity, you can:

  • rajm00's avatar
    rajm00
    Regular Visitor

    Thank you for your response. Would you happen to know if Microsoft is working on a fix?

  • You can change it depending on your CI/CD deployment method of choice. For example, when using the fabric-cicd Python library as a layer of abstraction you can change is with a parameter file.

  • Hi rajm00 

     

    As others mentioned, it is currently a limitation within Microsoft Fabric, because the database name in a Copy Job is stored as a literal. Your best bet is to change the Copy job into a Pipeline with a Copy activity. You can pass the database name as a Pipeline parameter. 

     

    Hope this helps - please appreciate giving a Kudos or accepting as a Solution