Azure / Azure/azure-rest-api-specs

Failed to process request content for Container Group when LogType is ContainerInstanceLogs

Open
#9,768 20 comments 10 reactions 0 assignees View on GitHub
Container Instances Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 2h
Merged PRs (30d)
424

Description

After tested, I found it failed to process request content for Container Group from service side when LogType is ContainerInstanceLogs. Could you help to have a look? Thanks.
Http request:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctest-cgtest/providers/Microsoft.ContainerInstance/containerGroups/backend

{
"location": "westeurope",
"properties": {
"containers": [
{
"name": "backend",
"properties": {
"image": "microsoft/aci-helloworld",
"command": [],
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"environmentVariables": [],
"resources": {
"requests": {
"memoryInGB": 1.5,
"cpu": 1
}
}
}
}
],
"restartPolicy": "Always",
"ipAddress": {
"ports": [
{
"protocol": "TCP",
"port": 80
}
],
"type": "Public"
},
"osType": "linux",
"volumes": [],
"diagnostics": {
"logAnalytics": {
"logType": "ContainerInstanceLogs",
"metadata": {},
"workspaceId": "xx-xx-xx-xx",
"workspaceKey": "xxxxxxxxx"
}
}
},
"tags": {}
}
```

Error message:
```
containerinstance.ContainerGroupsClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Error converting value \"ContainerInstanceLogs\" to type 'System.Nullable`1[Microsoft.Azure.CloudConsole.Providers.Common.Entities.LogAnalyticsLogType]'. Path 'properties.diagnostics.logAnalytics.logType', line 1, position 441.'."
```

Contributor guide

Open the contributing guide

Research direction

Start with the Container Groups PUT request shown in the issue, focusing on properties.diagnostics.logAnalytics.logType and the ContainerInstanceLogs value. Trace the corresponding Azure REST specification and compare its allowed value with the service error; done means the specification and request behavior agree, with a regression check for this payload.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.