Azure / Azure/azure-sdk-for-python
ContainerApps no longer passes on active_revisions_mode parameter
- Lingua principale
- Python
- Stelle
- 5.6k
- Fork
- 3.4k
- Merge medio
- 2g 2h
- PR unite (30g)
- 213
Descrizione
- **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
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Inizia con il file allegato test_bug.py e con l’entry point container_apps_client.container_apps.begin_create_or_update in azure-mgmt-appcontainers. Confronta la serializzazione della richiesta tra le versioni 4.0.0 e 5.0.0, quindi verifica che active_revisions_mode compaia nel corpo della richiesta e che la riproduzione di sticky-session non restituisca più l’errore di revision-mode.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- azure, python
- Ambito
- api, cloud
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 55/100