Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
KhanhND
New Member

Deployment Pipeline Error with Mirrored Database - Need Help!

Hi all,

I'm stuck with a deployment pipeline issue and hoping someone can help me out.

I have a Power BI report in DEV that connects to a mirrored database. When I try to deploy it through the deployment pipeline, I get this error:

"When deploying the items below, any related items must be included in the deployment or must already exist in the target folder."

The pipeline is forcing me to deploy the mirrored database along with the report, but I don't want to do that because PROD already has its own mirrored database that the report should connect to instead.

Interestingly, this only happens with mirrored databases - when I use Lakehouse, everything deploys fine without issues.

Is there any way to deploy the Power BI report without being forced to include the mirrored database? I just want the report to use the existing mirrored database in the target environment.

Has anyone run into this before? Any workarounds?

Thanks!

KhanhND_0-1754357130013.png

 



1 ACCEPTED SOLUTION
v-echaithra
Community Support
Community Support

Hi @KhanhND ,

Thanks for the update.

When working with Power BI deployment pipelines, mirrored databases present a unique challenge. Unlike other Fabric items such as Lakehouses, mirrored databases are treated as tightly coupled dependencies. This means that if a report or dataset references a mirrored database, Power BI enforces a rule during deployment: any related items like the mirrored database must either be included in the deployment package or already exist in the target workspace. Failing to meet this condition results in the following error:

"When deploying the items below, any related items must be included in the deployment or must already exist in the target folder."

Even when parameterization is used, mirrored databases are still treated as semantic model dependencies. This behavior differs from loosely coupled items like Lakehouses, where dynamic references through parameters are typically sufficient to avoid enforced inclusion during deployment.

To deploy Power BI reports without forcing the mirrored database to be included, you need to break the automatic dependency established by the Fabric UI. This requires rebuilding the dataset in Power BI Desktop, where you have full control over how data sources are configured.

1. Build the Dataset in Power BI Desktop
Begin by defining a parameter for the database name:
Go to Home > Transform Data > Manage Parameters.
Create a new text parameter (e.g., DatabaseName), setting its default value according to your DEV environment (e.g., Mirrored_Dev).
In the Power Query Editor, replace any hardcoded references to the mirrored database with the parameter. Avoid using static values like "Mirrored_Dev" directly in the M code.


2. Publish Manually to the Power BI Service
Once the report is built using dynamic parameters, save the PBIX file and manually publish it to the DEV workspace using Get Data > Upload a file > Local File.
Do not create the dataset directly from the Fabric UI, as this will automatically bind it to the mirrored database and reintroduce the hard dependency.


3. Configure Parameters and Validate Dependencies
In the Power BI Service:
Open the published semantic model (dataset).
Navigate to Settings > Parameters, and confirm the DatabaseName parameter is editable.
Set its value to the correct mirrored DB name for the DEV workspace.

Then, verify that the dataset is now treated as a standalone item, it should not show the mirrored database as a linked or dependent object in the workspace.

Hope this helps.
Warm regards,
Chaithra E

View solution in original post

6 REPLIES 6
v-echaithra
Community Support
Community Support

Hi @KhanhND ,

I hope the information provided is helpful.I wanted to check whether you were able to resolve the issue with the provided solutions.Please let us know if you need any further assistance.

Thank you.

v-echaithra
Community Support
Community Support

Hi @KhanhND ,

We’d like to follow up regarding the recent concern. Kindly confirm whether the issue has been resolved, or if further assistance is still required. We are available to support you and are committed to helping you reach a resolution.

Thank you for your patience and look forward to hearing from you.

Best Regards,
Chaithra E.

 

v-echaithra
Community Support
Community Support

Hi @KhanhND ,

Thanks for the update.

When working with Power BI deployment pipelines, mirrored databases present a unique challenge. Unlike other Fabric items such as Lakehouses, mirrored databases are treated as tightly coupled dependencies. This means that if a report or dataset references a mirrored database, Power BI enforces a rule during deployment: any related items like the mirrored database must either be included in the deployment package or already exist in the target workspace. Failing to meet this condition results in the following error:

"When deploying the items below, any related items must be included in the deployment or must already exist in the target folder."

Even when parameterization is used, mirrored databases are still treated as semantic model dependencies. This behavior differs from loosely coupled items like Lakehouses, where dynamic references through parameters are typically sufficient to avoid enforced inclusion during deployment.

To deploy Power BI reports without forcing the mirrored database to be included, you need to break the automatic dependency established by the Fabric UI. This requires rebuilding the dataset in Power BI Desktop, where you have full control over how data sources are configured.

1. Build the Dataset in Power BI Desktop
Begin by defining a parameter for the database name:
Go to Home > Transform Data > Manage Parameters.
Create a new text parameter (e.g., DatabaseName), setting its default value according to your DEV environment (e.g., Mirrored_Dev).
In the Power Query Editor, replace any hardcoded references to the mirrored database with the parameter. Avoid using static values like "Mirrored_Dev" directly in the M code.


2. Publish Manually to the Power BI Service
Once the report is built using dynamic parameters, save the PBIX file and manually publish it to the DEV workspace using Get Data > Upload a file > Local File.
Do not create the dataset directly from the Fabric UI, as this will automatically bind it to the mirrored database and reintroduce the hard dependency.


3. Configure Parameters and Validate Dependencies
In the Power BI Service:
Open the published semantic model (dataset).
Navigate to Settings > Parameters, and confirm the DatabaseName parameter is editable.
Set its value to the correct mirrored DB name for the DEV workspace.

Then, verify that the dataset is now treated as a standalone item, it should not show the mirrored database as a linked or dependent object in the workspace.

Hope this helps.
Warm regards,
Chaithra E

v-echaithra
Community Support
Community Support

Hi @KhanhND ,

We wanted to follow up to see if the issue you reported has been fully resolved. If you still have any concerns or need additional support, please don’t hesitate to let us know, we’re here to help.

We truly appreciate your patience and look forward to assisting you further if needed.

Warm regards,
Chaithra E.

Hi @v-echaithra ,

Thank you for following up. I followed the suggested approach of using a parameter for the mirrored database name.

However, when attempting to deploy, the system still requires the mirrored database to be included in the deployment package, and I cannot configure parameter rules without completing an initial deployment.

I also tried intentionally entering an incorrect database name to break the dependency, successfully deployed the report the first time, then updated the parameter with the correct database name and redeployed. Unfortunately, I still encountered the same "Can't start the deployment..." error.

Could you please advise if there is any supported way to deploy the report without including the mirrored database in the deployment package, given that the target environment already has its own mirrored DB instance?

KhanhND_1-1754895780198.png

 

v-echaithra
Community Support
Community Support

Hi @KhanhND ,

Thank you for reaching out to Microsoft Community.

The deployment error you're encountering "Can't start the deployment. When deploying the items below, any related items must be included in the deployment or must already exist in the target folder" , typically occurs when a Power BI report, such as Demo_Deploy_4, references a mirrored database or other dependent item that either isn't included in the deployment package or doesn't already exist in the target workspace. To resolve this issue without redeploying the mirrored database especially since your target environment already has its own version, you should decouple the report from a hard dependency using parameterization.
In Power BI Desktop, begin by creating a parameter to represent the mirrored database name e.g., DatabaseName and modify your data source's M query to reference this parameter instead of a fixed database name. Once parameterized, publish the report to the DEV workspace. Then, within the deployment pipeline, navigate to the stage settings for each environment (DEV, TEST, PROD), go to the Parameters section, and assign environment-specific values to the DatabaseName parameter. For example, set Dev_MirroredDB for DEV and Prod_MirroredDB for PROD.
This approach allows the report to dynamically connect to the correct mirrored database in each environment, removing the need to include the mirrored DB in the deployment itself. Alternatively, if you do wish to include the mirrored database, you can expand the deployment item list in the pipeline, select all related dependencies often shown as grayed-out items, and proceed with the deployment. However, this is not recommended if the target environment already has the necessary data infrastructure, as it could result in overwriting or duplication. Using parameterization with stage based overrides is the preferred and cleaner approach for managing environment specific resources in deployment pipelines.

Hope this helps.
Thank you,
Chaithra E.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors