- Package Name: azure.ai.ml
- Package Version: 1.33.0
- Operating System:
- Python Version:
Describe the bug
Starting with the azure-ai-ml SDK version shipped in Azure CLI 2.86.0, setting the default deployment on a batch endpoint fails with a serialization error. The SDK sends deployment_name (snake_case) in the JSON body instead of deploymentName (camelCase), which the service rejects.
Error message:
Could not find member 'deployment_name' on object of type 'BatchEndpointDefaults'. Path 'properties.defaults.deployment_name'
Additionally, when the endpoint has no existing defaults, the operation exits successfully but silently fails to set the default deployment — meaning the --set-default flag is completely broken in both states.
To Reproduce
Via Python SDK:
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
Create or get an endpoint
endpoint = ml_client.batch_endpoints.get("my-batch-endpoint")
Set defaults (this is the documented/expected usage)
endpoint.defaults = {"deployment_name": "my-deployment"}
ml_client.batch_endpoints.begin_create_or_update(endpoint)
ERROR: Could not find member 'deployment_name' on object of type 'BatchEndpointDefaults'
Via Azure CLI:
az ml batch-deployment create
--file deployment.yml
--resource-group myRG
--workspace-name myWorkspace
--set-default
Expected behavior
A clear and concise description of what you expected to happen.
The SDK should serialize the defaults dict to the correct camelCase wire format:
{
"properties": {
"defaults": {
"deploymentName": "my-deployment"
}
}
}
Actual behavior
The SDK sends snake_case keys unchanged:
{
"properties": {
"defaults": {
"deployment_name": "my-deployment"
}
}
}
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
Describe the bug
Starting with the azure-ai-ml SDK version shipped in Azure CLI 2.86.0, setting the default deployment on a batch endpoint fails with a serialization error. The SDK sends deployment_name (snake_case) in the JSON body instead of deploymentName (camelCase), which the service rejects.
Error message:
Could not find member 'deployment_name' on object of type 'BatchEndpointDefaults'. Path 'properties.defaults.deployment_name'
Additionally, when the endpoint has no existing defaults, the operation exits successfully but silently fails to set the default deployment — meaning the --set-default flag is completely broken in both states.
To Reproduce
Via Python SDK:
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential
ml_client = MLClient(DefaultAzureCredential(), subscription_id, resource_group, workspace)
Create or get an endpoint
endpoint = ml_client.batch_endpoints.get("my-batch-endpoint")
Set defaults (this is the documented/expected usage)
endpoint.defaults = {"deployment_name": "my-deployment"}
ml_client.batch_endpoints.begin_create_or_update(endpoint)
ERROR: Could not find member 'deployment_name' on object of type 'BatchEndpointDefaults'
Via Azure CLI:
az ml batch-deployment create
--file deployment.yml
--resource-group myRG
--workspace-name myWorkspace
--set-default
Expected behavior
A clear and concise description of what you expected to happen.
The SDK should serialize the defaults dict to the correct camelCase wire format:
{
"properties": {
"defaults": {
"deploymentName": "my-deployment"
}
}
}
Actual behavior
The SDK sends snake_case keys unchanged:
{
"properties": {
"defaults": {
"deployment_name": "my-deployment"
}
}
}
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.