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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Johan
Advocate II
Advocate II

api to business central sandbox environment fails using Dynamics365BusinessCentral.Contents

When connecting to a Business Central company in the sandbox environment I get this error:

The environment "Production" does not exist. Tenant: xxxx. The exception was raised by the IDbCommand interface.

 

It's trying to connect to the Production environment by default

 

How  to set the right Environment?

 

Thanks,

Johan

1 ACCEPTED SOLUTION
BhavinVyas3003
Super User
Super User

Hi @Johan ,

 

In Power BI (Power Query M), modify your connection like this:

let

    Source = Dynamics365BusinessCentral.Contents(

        "yourtenant.onmicrosoft.com",

        "Sandbox"              // ← specify your sandbox environment here

    )

in

    Source

Replace "yourtenant.onmicrosoft.com" and "Sandbox" with exact values from your Azure AD and Business Central admin portal.


Thanks,
Bhavin
Problem solved? Hit “Accept as Solution” and high-five me with a Kudos! Others will thank you later!

View solution in original post

4 REPLIES 4
v-echaithra
Community Support
Community Support

Hi @Johan ,

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Chaithra.

v-echaithra
Community Support
Community Support

Hi @Johan ,

We wanted to kindly follow up to check if the solution provided by @BhavinVyas3003   for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

 

Regards,
Chaithra.

v-echaithra
Community Support
Community Support

Hi @Johan ,

May I ask if you have gotten this issue resolved?

 

If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

 

Regards,
Chaithra.

BhavinVyas3003
Super User
Super User

Hi @Johan ,

 

In Power BI (Power Query M), modify your connection like this:

let

    Source = Dynamics365BusinessCentral.Contents(

        "yourtenant.onmicrosoft.com",

        "Sandbox"              // ← specify your sandbox environment here

    )

in

    Source

Replace "yourtenant.onmicrosoft.com" and "Sandbox" with exact values from your Azure AD and Business Central admin portal.


Thanks,
Bhavin
Problem solved? Hit “Accept as Solution” and high-five me with a Kudos! Others will thank you later!

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.