Azure / Azure/azure-rest-api-specs

Creating non linux app service plan should fail when the kind field sets to non linux and the Reserved field sets to true

Open
#10,067 1 comment 0 reactions 0 assignees View on GitHub
App Services Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
3d 37m
Merged PRs (30d)
446

Description

After tested, I found service api would always create `linux` app service plan even if the `kind` field sets to `"Windows/App/elastic/FunctionApp/xenon"` and the `Reserved` field sets to `true`. I assume it doesn't make sense. It should throw error message if it doesn't allow this kind of scenario.

Below is the example of http request.
1. Try to create app service plan whose the kind field is windows and the reserved field is true:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/test-appservice-rg02/providers/Microsoft.Web/serverfarms/acctestASP-windows2

{
"kind": "Windows",
"location": "westeurope",
"properties": {
"reserved": true,
"isXenon": false
},
"sku": {
"name": "S1",
"tier": "Standard",
"size": "S1",
"capacity": 0
},
"tags": {}
}
```

2. Get app service plan but the kind field is still linux:
```
GET https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/test-appservice-rg02/providers/Microsoft.Web/serverfarms/acctestASP-windows2?api-version=2019-08-01

{
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/test-appservice-rg02/providers/Microsoft.Web/serverfarms/acctestASP-windows2",
"name": "acctestASP-windows2",
"type": "Microsoft.Web/serverfarms",
"kind": "linux",
"location": "West Europe",
"tags": {},
"properties": {
...
"kind": "linux",
...
},
}
```

Contributor guide

Open the contributing guide

Research direction

Start by locating the API definition for the Microsoft.Web/serverfarms endpoint and review how the request's kind and properties.reserved fields are modeled. Reproduce the PUT example, then define the expected rejection for non-Linux kinds with reserved set to true and verify that valid app service plan requests still work.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, openapi
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.