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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RichOB
Contributor III

Dynamics > PowerBi DataSouce error (404) default company cannot be found

I am using a Web Services query in Dynamics, then pulling the data into PowerBi using the oData process. I can refresh the data in the desktop dashboard fine, but when I want to schedule an automated refresh, it says:

 

OData: Request failed (404): The remote server returned an error: (404) Not Found. (Cannot process the request because the default company cannot be found.

 

How can I fix this, please?

 

I've changed a few bits for anonymity, but the url is: 

https://api.businesscentral.dynamics.com/v2.0/bge9b7ec-c185-482a-b3f2-6d21603e8877/Production/ODataV...

 

Thanks

1 ACCEPTED SOLUTION
tayloramy
Contributor

Hi @RichOB

 

That error means the refresh account in the Power BI Service is hitting Business Central without a “default company,” so BC returns 404. Desktop works because your user likely has a default company set, but the cloud refresh identity does not.

Quick solution

  1. Put the company in the URL (don’t rely on “default”).
    OData v4 web services:
    https://api.businesscentral.dynamics.com/v2.0/<tenant>/<environment>/ODataV4/Company('Your%20Company%20Name')/<WebServiceName>
    Notes: URL-encode spaces/commas, and if the name contains a single quote, escape it as two single quotes. Docs: Publish a Web Service.
    Or switch to the Web API (recommended) and use company ID:
    https://api.businesscentral.dynamics.com/v2.0/<tenant>/<environment>/api/v2.0/companies(<companyId>)/...
    Get companyId from GET /api/v2.0/companies. Docs: GET companies.
  2. Update dataset credentials in the Service (Settings > Datasets > Data source credentials). Use OAuth2 and sign in with a BC user that has access to that company. If you’re using an app/service principal, it must be granted access and you still need to include the company in the URL. Docs: Service-to-service authentication, and Power BI refresh notes: Refresh troubleshooting.
  3. Test the company list if you’re unsure of the exact name/ID:
    OData v4: hit .../ODataV4/Company to see available companies.
    Web API: hit .../api/v2.0/companies.
    (The “default company cannot be found” guidance to add company=[name] or include Company in the path is a known fix discussed here: community thread with the exact error, plus MS docs above.)

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

View solution in original post

4 REPLIES 4
tayloramy
Contributor

Hi @RichOB

 

That error means the refresh account in the Power BI Service is hitting Business Central without a “default company,” so BC returns 404. Desktop works because your user likely has a default company set, but the cloud refresh identity does not.

Quick solution

  1. Put the company in the URL (don’t rely on “default”).
    OData v4 web services:
    https://api.businesscentral.dynamics.com/v2.0/<tenant>/<environment>/ODataV4/Company('Your%20Company%20Name')/<WebServiceName>
    Notes: URL-encode spaces/commas, and if the name contains a single quote, escape it as two single quotes. Docs: Publish a Web Service.
    Or switch to the Web API (recommended) and use company ID:
    https://api.businesscentral.dynamics.com/v2.0/<tenant>/<environment>/api/v2.0/companies(<companyId>)/...
    Get companyId from GET /api/v2.0/companies. Docs: GET companies.
  2. Update dataset credentials in the Service (Settings > Datasets > Data source credentials). Use OAuth2 and sign in with a BC user that has access to that company. If you’re using an app/service principal, it must be granted access and you still need to include the company in the URL. Docs: Service-to-service authentication, and Power BI refresh notes: Refresh troubleshooting.
  3. Test the company list if you’re unsure of the exact name/ID:
    OData v4: hit .../ODataV4/Company to see available companies.
    Web API: hit .../api/v2.0/companies.
    (The “default company cannot be found” guidance to add company=[name] or include Company in the path is a known fix discussed here: community thread with the exact error, plus MS docs above.)

 

If you found this helpful, consider giving some Kudos. If I answered your question or solved your problem, mark this post as the solution.

v-echaithra
Honored Contributor

Hi @RichOB ,

Thank you @tayloramy  for your inputs.

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
Honored Contributor

Hi @RichOB ,

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.

Best Regards,
Chaithra E.

v-echaithra
Honored Contributor

Hi @RichOB ,

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.

Best Regards,
Chaithra E.

Helpful resources

Announcements
Users online (11,088)