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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

404 Client Error: Not Found for url https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets

I am connecting via a call to the API like this (ie tenantid and service principal) :

app = msal.ConfidentialClientApplication(client_id, authority=authority_url, client_credential=secret_value)

result = app.acquire_token_for_client(scopes=scope)
accessToken = result['access_token']
headers = {
  'Authorization': f'Bearer {accessToken}'
}
response = requests.request('get', url, headers)
 

url = f'https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes?$top=1'

The above call works when I use a datasetId that I own but receives

404 Client Error: Not Found for url

when it a dataset that someone else owns

My code needs to run without me being connected. How do I resolve?

 

1 ACCEPTED SOLUTION
jaineshp
Memorable Member
Memorable Member

Hey @Anonymous,

Quick Fix for Your 404 Error

The Problem: Your service principal doesn't have access to datasets owned by others.

Solution Steps:

  1. Add Service Principal to Workspace
    • Go to workspace settings → Access tab
    • Add your App ID as Member/Admin role
  2. Get Dataset Permissions
    • Ask dataset owner to share dataset with your service principal
    • Or get added as workspace admin to bypass this
  3. Check Tenant Settings
    • Power BI admin portal → "Service principals can use APIs" must be ON
    • Usually already enabled in most orgs
  4. Test It
    url = f'https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes?$top=1'

Pro Tip: If you're hitting this often, ask for a dedicated "API workspace" where all shared datasets live and your service principal has permanent access.

Still getting 404? Double-check your workspaceId and datasetId are correct. Sometimes copying from URL gives wrong IDs.

That's it. The permissions thing trips up everyone initially - you're not alone on this one.

 

Fixed? ✓ Mark it • Share it • Help others!


Best Regards,
Jainesh Poojara | Power BI Developer

View solution in original post

5 REPLIES 5
v-venuppu
Community Support
Community Support

Hi @Anonymous ,

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-venuppu
Community Support
Community Support

Hi @Anonymous ,

May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

Thank you.

v-venuppu
Community Support
Community Support

Hi @Anonymous ,

Thank you for reaching out to Microsoft Fabric Community.

Thank you @jaineshp for the prompt response.

I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.

Thank you.

jaineshp
Memorable Member
Memorable Member

Hey @Anonymous,

Quick Fix for Your 404 Error

The Problem: Your service principal doesn't have access to datasets owned by others.

Solution Steps:

  1. Add Service Principal to Workspace
    • Go to workspace settings → Access tab
    • Add your App ID as Member/Admin role
  2. Get Dataset Permissions
    • Ask dataset owner to share dataset with your service principal
    • Or get added as workspace admin to bypass this
  3. Check Tenant Settings
    • Power BI admin portal → "Service principals can use APIs" must be ON
    • Usually already enabled in most orgs
  4. Test It
    url = f'https://api.powerbi.com/v1.0/myorg/groups/{workspaceId}/datasets/{datasetId}/refreshes?$top=1'

Pro Tip: If you're hitting this often, ask for a dedicated "API workspace" where all shared datasets live and your service principal has permanent access.

Still getting 404? Double-check your workspaceId and datasetId are correct. Sometimes copying from URL gives wrong IDs.

That's it. The permissions thing trips up everyone initially - you're not alone on this one.

 

Fixed? ✓ Mark it • Share it • Help others!


Best Regards,
Jainesh Poojara | Power BI Developer

Anonymous
Not applicable

It works!  Thank you.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.