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

Get Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.

Reply
jbauti10
Advocate I
Advocate I

Update Semantic Model REST API Endpoint Failing: {'errorCode': 'RequiredOptionsMissing'}

Hello,

I'm currently trying to update a semantic model definition via the REST API endpoint but I keep hitting this error:

Operation failed: {'errorCode': 'RequiredOptionsMissing', 'message': 'The operation cannot be completed due to missing options', 'isRetriable': False, 'parameters': [{'name': 'optionName'}]}

I checked the documentation and I'm not missing any of the required parameters to update the model. Also, this was previously working. Here's a small snippet of the code I'm using: 

encoded_payload = base64.b64encode(
        json.dumps(model_bim_content, indent=2).encode('utf-8')
    ).decode('utf-8')

    remaining_definition_parts = [
        part
        for part in definition.get('definition', {}).get('parts', [])
        if part['path'] != 'model.bim'
    ]

    update_payload = {
        'definition': {
            'parts': [
                {
                    'path': 'model.bim',
                    'payload': encoded_payload,
                    'payloadType': 'InlineBase64'
                },
                *remaining_definition_parts
            ]
        }
    }

    update_url = f"https://api.fabric.microsoft.com/v1/workspaces/{workspace_id}/semanticModels/{semantic_model_id}/updateDefinition"

    print("Updating semantic model definition...")
    response = api_write(
        'post', update_url, headers, dry_run=dry_run, json=update_payload
    )

    if response.status_code == 202:
        operation_id = response.headers.get('x-ms-operation-id')
        location = response.headers.get('Location')
        print(f"Async update started: {operation_id}")
        poll_async_operation(location, headers, fetch_result=False)
        print(
            f"Successfully updated semantic model '{semantic_model_name}' "
            f"datasource to lakehouse '{lakehouse_name}'"
        )
        return True
    elif response.status_code == 200:
        print(
            f"Successfully updated semantic model '{semantic_model_name}' "
            f"datasource to lakehouse '{lakehouse_name}'"
        )
        return True
    else:
        print(f"Update failed with status {response.status_code}")
        print(f"Response: {response.text}")
        response.raise_for_status()

 

Basically, after making a few changes to the model definition, I rebuild the payload and trigger the endpoint. It first goes into the async operation but at the end it fails with the error I mention above. Not sure if this issue is related to this other issue the community pointed out.

Is any one else experiencing the same problem? If so, does anyone have an idea of how this can be fixed?

Thanks in advance!

6 REPLIES 6
suhailj93
Frequent Visitor

Temporary fix: If you don't want delete the dataset then manually then publish the dataset from Power Bi desktop once. Successive deployments from API are working after the manual deployment.

ibarrau
Super User
Super User

Hi. EDIT: they have confirmed there is an issue there. Let me share alternative after asking for more info.

Can you share the whole code? I mean, we don't know what api_write is. For example, I don't remember requests allowing dry run by default. Also the encoded is for all files and not just model.bim. I would say base64.b64encode(file_content).decode("utf-8") it's enough. The rest of the code kinds of look good. Make sure the building parts are ok. Are you sure you are working with TMSL, like getting bim file... I haven't tried this request, I'm using core upload definition items for my uploads even semantic models.

In addition, my code is using data instead of json, so I do json.dump for the final json with definition and all parts before sending the post. All that is part of my library SimplePBI at pypi, it's free and you can just use a simple request like: simple_deploy_semantic_model(workspace_id, item_path). That will solve it https://pypi.org/project/simplepbi/

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Hi @ibarrau,

Thanks for your reply.

The `api_write()` function is just a wrapper around the API requests. It supports dry runs and uses `request_with_backoff()` to handle retries and avoid API rate limiting issues.

I am encoding all files in the definition package, not just the modified `model.bim`. The reason I’m working directly with TMSL is that I need access to the explicit semantic model definition so I can programmatically modify specific objects and properties as needed.

I’ll also take a look at the library you mentioned.


Thanks!

v-aatheeque
Community Support
Community Support

Hi  

Thank you for reporting this issue.

This is a known product issue currently being tracked by the product team. The behavior matches the existing issue reported here: https://github.com/microsoft/fabric-cicd/issues/950

At this time, the issue is under investigation by the product team. Since this is a backend/API-side issue, there is no confirmed workaround currently available.

We recommend monitoring the above thread for further updates from product team.

 

Hello @v-aatheeque ,

Thank you for your reply.

Would it be possible to add the issue to the fabric status page so it is easier to track its progress?

Thanks!

Hi  @jbauti10 

Thank you for the suggestion.

Unfortunately, the Fabric Status Page is managed internally by Microsoft and is typically reserved for service-wide incidents or outages that have been formally declared by the product team.

As support, we do not have the ability to publish or add individual product bugs directly to the status page.

Helpful resources

Announcements
June Fabric Update Carousel

Fabric Monthly Update - June 2026

Check out the June 2026 Fabric update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.