Forum Discussion

Faber1975's avatar
Faber1975
Frequent Visitor
1 year ago

Unable to Update a GraphQLApi Definition using the Fabric management API

With Powershell code, I successfully worked out to create a GraphQLApi as described

here: https://learn.microsoft.com/en-us/rest/api/fabric/graphqlapi/items/create-graphqlapi

 

However, I am unable to update its Definition using the following API:

https://learn.microsoft.com/en-us/rest/api/fabric/graphqlapi/items/update-graphqlapi-definition

 

More, precisely, I succeed if I use a near-empty graphql-definition.json file like the following:

{ "$schema": "https://developer.microsoft.com/json-schemas/fabric/item/graphqlApi/definition/1.0.0/schema.json" }

 

But if I try to use a real-case graphql-definition.json, got from my AzureDevops GIT (after a commit made on a hand-made GraphQL API), it fails with the following (not meaningful) response.

@{status=Failed; createdTimeUtc=07/22/2025 07:16:58; lastUpdatedTimeUtc=07/22/2025 07:16:59; percentComplete=; error=}

 

For completness, the following is the "graphql-definition.json":

{
"$schema": "https://developer.microsoft.com/json-schemas/fabric/item/graphqlApi/definition/1.0.0/schema.json",
"datasources": [
{
"connectionId": "<MY CONNECTION ID>",
"objects": [
{
"actions": {
"Query": "Enabled",
"Query_by_pk": "Enabled",
"Create": "Enabled",
"Update": "Enabled",
"Delete": "Enabled"
},
"fieldMappings": {
"A": "A",
"B": "B",
"C": "C"
},
"graphqlType": "TEST",
"relationships": [],
"sourceObject": "dbo.TEST",
"sourceObjectType": "Table"
}
],
"sourceItemId": "<MY WAREHOUSE ID>",
"sourceType": "Warehouse",
"sourceWorkspaceId": "<MY WORKSPACE ID>"
}
]
}

 

NOTE: For authenticating to the management API, I use a service principal.

 

 

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Faber1975 ,

    1. Clear and Reconnect Linked Services
      Head into your workspace settings and open the Linked services section. Remove any old or cached connections tied to your Lakehouse destination. Then, re-add the Lakehouse connection make sure you’re using the right authentication method (like AAD or service principal) that fits your workspace setup.
    1. Re-authenticate in Dataflow Settings
      Don’t stop at just reconnecting the service. Go into your Dataflow Gen2 settings and re-enter your credentials there too. Even if the linked service looks fine, the dataflow itself might need a fresh authentication. Run a connection test to confirm everything’s working.
    1. Double-Check Permissions
      Even if you’re listed as an Admin or Owner, it’s worth verifying that you have explicit Write permissions on the Lakehouse. Sometimes, row-level security or workspace policies can quietly block access in ways that aren’t obvious.
    1. Look for Expired Access Tokens
      If your setup uses Service Principals or Managed Identities, check in Azure AD to make sure the tokens haven’t expired or been revoked. This can silently break connections and lead to unexpected CU usage.
    1. Update to the Latest Fabric Features
      Microsoft occasionally rolls out backend fixes that resolve these kinds of issues. Try re-publishing your Dataflow, or even create a new Lakehouse destination from scratch to see if the problem clears up.
    1. Try a Different User Account
      If you can, ask a teammate with similar permissions to recreate the connection and dataflow. This can help uncover tenant-level issues or consent problems tied to your account.
    1. Check Activity Logs for Hidden Errors
      Go to Fabric > Admin Portal > Activity log and look for any permission or access errors that might not show up in the Dataflow UI. These logs can reveal what’s really going on behind the scenes.

    If you’re still facing any issues after that, feel free to let us know and we can troubleshoot further together.

    Regards,
    Akhil.

  • Faber1975's avatar
    Faber1975
    Frequent Visitor

    Thank you for your reply.

    Unfortunately your suggestions (AI generated?) do not apply:

    - I have no linked services

    - I use a service account, not a user account

    - Permissions are ok: I can successfully invoke the Create Graph QL API, and I can also invoke the Update GraphQL API, passing an "almost empty" payload (see my 1st message).

    - The Service Principal is not expired: I use it in all other pipelines 

    - In point 6 you talk about a Data flow, but I did not mention data flows (I have no data flows at all)

    - I am not the admin, so I cannot access the activity logs.

     

    Many thanks for your support. Fabrizio

     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Faber1975 ,

    Yes the above few earlier suggestion are from copilot and in addition you can check out the below points as follows. 

    This approach that might help, start with your working “almost empty” GraphQL schema and slowly add sections of your full definition back in like the types, queries, and mutations bit by bit. This lets you narrow down exactly which part of the schema is causing the update to silently fail with that {status=Failed; error=} message.

    It’s also a good idea to run your full 'graphql-definition.json' through a GraphQL validator.

    You can use https://graphql-validator.com or tools like 'graphql-cli 'or 'graphql-js' if you're working locally.

     

    If the issue still persists try to open a support ticket https://support.fabric.microsoft.com/support/  




    Regards,
    Akhil. 

     

    • Faber1975's avatar
      Faber1975
      Frequent Visitor

      Thanks Akhil, I'll try to "dissect" the json. It must be surely syntactically correct because it is automatically generated by Fabric when I commit my API to GIT.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Faber1975 ,

    Glad to hear you’re trying that approach! Just checking back were you able to narrow it down and get the deployment working after dissecting the JSON?

    Regards,
    Akhil.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Faber1975 ,

    I hope the response provided helped in resolving the issue. If the issue still persists try to open a support ticket. happy to address. 

    Regards,
    Akhil.