Azure / Azure/azure-sdk-for-python
ContainerApps no longer passes on active_revisions_mode parameter
- Dominant language
- Python
- Stars
- 5.6k
- Forks
- 3.4k
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 193
Description
- **Package Name**: azure-mgmt-appcontainers
- **Package Version**: 5.0.0
- **Operating System**: Linux
- **Python Version**: 3.14
**Describe the bug**
When creating a Container App using `container_apps_client.container_apps.begin_create_or_update`, the `active_revisions_mode` is not passed on to the HTTP request.
This is the configuration:
```
configuration=Configuration(
active_revisions_mode=ActiveRevisionsMode.SINGLE,
ingress=Ingress(
external=True,
target_port=80,
sticky_sessions=IngressStickySessions(affinity=affinity),
)
),
```
The JSON that is actually being send to Azure (verified by running the calls through a proxy) :
```
{
"location": "francecentral",
"properties": {
"managedEnvironmentId": "/subscriptions/.../resourceGroups/ls_test_2c0e06/providers/Microsoft.App/managedEnvironments/lstest12667a",
"configuration": {
"ingress": {
"external": true,
"targetPort": 80,
"stickySessions": {
"affinity": "sticky"
}
}
},
"template": {
"containers": [
{
"name": "testcontainer",
"image": "mcr.microsoft.com/k8se/quickstart:latest"
}
]
}
}
}
```
Because the `active_revisions_mode` is not passed on, the call fails:
```
{
"error": {
"code": "ContainerAppInvalidIngressStickySessionRevisionMode",
"message": "Sticky Session is not supported for revision mode."
}
}
```
**To Reproduce**
Steps to reproduce the behavior:
[test_bug.py](https://github.com/user-attachments/files/30005014/test_bug.py)
**Expected behavior**
1. The parameter to be passed on in the request body
2. No error to occur
**Additional context**
This worked fine under version 4.0.0, and only started failing with 5.0.0
Contributor guide
Research direction
Start with the attached test_bug.py and the container_apps_client.container_apps.begin_create_or_update entry point in azure-mgmt-appcontainers. Compare request serialization between versions 4.0.0 and 5.0.0, then verify that active_revisions_mode appears in the request body and the sticky-session reproduction no longer returns the revision-mode error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, python
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100