Azure / Azure/azure-rest-api-specs
The WeekOfYear property of MS Sql Database isn't set correctly after provisioned successfully
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
After tested, seems the `WeekOfYear` property of [MS Sql Database](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/LongTermRetentionPolicies.json#L79) doesn't take effect after provisioned successfully. The API should set it correctly or throw corresponding error. Could you help take a look? Thanks in advance.
Http request:
```
PUT https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mssql-test03/providers/Microsoft.Sql/servers/acctest-sqlserver-test03/databases/acctest-db-test03/backupLongTermRetentionPolicies/default
{
"properties": {
"weeklyRetention": "P12W",
"weekOfYear": 1
}
}
```
API response:
```
GET https://management.azure.com/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mssql-test03/providers/Microsoft.Sql/servers/acctest-sqlserver-test03/databases/acctest-db-test03/backupLongTermRetentionPolicies/default?api-version=2020-11-01-preview
{
"properties": {
"weeklyRetention": "P12W",
"monthlyRetention": "PT0S",
"yearlyRetention": "PT0S",
"weekOfYear": 0
},
"id": "/subscriptions/xx-xx-xx-xx/resourceGroups/acctestRG-mssql-test03/providers/Microsoft.Sql/servers/acctest-sqlserver-test03/databases/acctest-db-test03/backupLongTermRetentionPolicies/default",
"name": "default",
"type": "Microsoft.Sql/servers/databases/backupLongTermRetentionPolicies"
}
```
Contributor guide
Research direction
Start with specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/LongTermRetentionPolicies.json around line 79 and compare the documented WeekOfYear property with the PUT and GET payloads in the issue. Determine whether the API should preserve weekOfYear=1 after provisioning or return a corresponding error; done means that behavior is represented correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, openapi, sql
- Domain
- api, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100