Azure / Azure/azure-rest-api-specs

`Microsoft.Sql/servers` bug: `administrators` property set, but ignored

Open
#16,423 2 comments 0 reactions 0 assignees View on GitHub
customer-reported question Service Attention SQL
Dominant language
TypeSpec
Stars
3.1k
Forks
6k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

When trying to set the `properties.administrators` property in `Microsoft.Sql/servers` createUpdate request for an existing server, nothing happens. Is this expected behaviour or a bug?:
```
PUT /subscriptions//resourceGroups/acctestRG-mssql-211015113918523226/providers/Microsoft.Sql/servers/acctestsqlserver211015113918523226?api-version=2021-02-01-preview HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.16.6 (amd64-darwin) go-autorest/v14.2.1 Azure-SDK-For-Go/v58.0.0 sql/v5.0 HashiCorp Terraform/1.0.5 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azurerm/acc pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 296
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 93484ffa-cd98-9b67-5173-6a1da36e3e91
Accept-Encoding: gzip

{"location":"westeurope","properties":{"administratorLogin":"missadministrator","administrators":{"administratorType":"ActiveDirectory","principalType":"Application","login":"AzureAD Admin","sid":"a009252d-9bb1-418e-803b-939f87182168"},"publicNetworkAccess":"Enabled","version":"12.0"},"tags":{}}
2021/10/15 11:43:32 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions//resourceGroups/acctestRG-mssql-211015113918523226/providers/Microsoft.Sql/servers/acctestsqlserver211015113918523226?api-version=2021-02-01-preview:
HTTP/2.0 202 Accepted
Content-Length: 74

2021/10/15 11:43:36 [DEBUG] AzureRM Request:
GET /subscriptions//resourceGroups/acctestRG-mssql-211015113918523226/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/66e0b7a0-7caa-4dba-aac3-0d4ce9d2eb91?api-version=2021-02-01-preview HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.16.6 (amd64-darwin) go-autorest/v14.2.1 Azure-SDK-For-Go/v58.0.0 sql/v5.0 HashiCorp Terraform/1.0.5 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azurerm/acc pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 93484ffa-cd98-9b67-5173-6a1da36e3e91
Accept-Encoding: gzip

2021/10/15 11:43:36 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions//resourceGroups/acctestRG-mssql-211015113918523226/providers/Microsoft.Sql/locations/westeurope/serverAzureAsyncOperation/66e0b7a0-7caa-4dba-aac3-0d4ce9d2eb91?api-version=2021-02-01-preview:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Fri, 15 Oct 2021 09:43:36 GMT
Expires: -1
Pragma: no-cache
Retry-After: 15
Server: Microsoft-HTTPAPI/2.0
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 93484ffa-cd98-9b67-5173-6a1da36e3e91
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11992
X-Ms-Request-Id: f5d8c083-d6c0-407c-a296-6bdd5a5ee154
X-Ms-Routing-Request-Id: WESTEUROPE:20211015T094336Z:c9ea393b-5157-4aa8-b0ab-9cde2a6d9c14

{"name":"66e0b7a0-7caa-4dba-aac3-0d4ce9d2eb91","status":"Succeeded","startTime":"2021-10-15T09:43:32.067Z"}
2021/10/15 11:44:39 [DEBUG] AzureRM Request:
GET /subscriptions//resourceGroups/acctestRG-mssql-211015113918523226/providers/Microsoft.Sql/servers/acctestsqlserver211015113918523226?api-version=2021-02-01-preview HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.16.6 (amd64-darwin) go-autorest/v14.2.1 Azure-SDK-For-Go/v58.0.0 sql/v5.0 HashiCorp Terraform/1.0.5 (+https://www.terraform.io) Terraform Plugin SDK/2.7.0 terraform-provider-azurerm/acc pid-222c6c49-1b0a-5959-a213-6608f9eb8820
X-Ms-Correlation-Request-Id: 93484ffa-cd98-9b67-5173-6a1da36e3e91
Accept-Encoding: gzip

2021/10/15 11:44:39 [DEBUG] AzureRM Response for https://management.azure.com/subscriptions//resourceGroups/acctestRG-mssql-211015113918523226/providers/Microsoft.Sql/servers/acctestsqlserver211015113918523226?api-version=2021-02-01-preview:
HTTP/2.0 200 OK
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Fri, 15 Oct 2021 09:44:38 GMT
Expires: -1
Pragma: no-cache
Server: Microsoft-HTTPAPI/2.0
Strict-Transport-Security: max-age=31536000; includeSubDomains
Vary: Accept-Encoding
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 93484ffa-cd98-9b67-5173-6a1da36e3e91
X-Ms-Ratelimit-Remaining-Subscription-Reads: 11991
X-Ms-Request-Id: 27dc715a-020a-4196-b17d-5e488fd676e7
X-Ms-Routing-Request-Id: WESTEUROPE:20211015T094439Z:5f794f92-ba58-4d2c-b361-5f03abc11868

{"kind":"v12.0","properties":{"administratorLogin":"missadministrator","version":"12.0","state":"Ready","fullyQualifiedDomainName":"acctestsqlserver211015113918523226.database.windows.net","privateEndpointConnections":[],"publicNetworkAccess":"Enabled","restrictOutboundNetworkAccess":"Disabled"},"location":"westeurope","tags":{},"id":"/subscriptions//resourceGroups/acctestRG-mssql-211015113918523226/providers/Microsoft.Sql/servers/acctestsqlserver211015113918523226","name":"acctestsqlserver211015113918523226","type":"Microsoft.Sql/servers"}
```

Related to: [Terraform issue](https://github.com/hashicorp/terraform-provider-azurerm/issues/13677).

Contributor guide

Open the contributing guide

Research direction

Start with the Microsoft.Sql/servers createUpdate request and compare the submitted administrators property with the returned server payload. Then read the related Terraform issue to determine whether the REST specification or the service behavior is at fault; done means the expected administrators update behavior is established and reflected in the specification if appropriate.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.