Azure / Azure/azure-rest-api-specs

GET Microsoft.Security/workspaceSettings/default is missing property workspaceId

Open
#14,138 2 comments 0 reactions 0 assignees View on GitHub
question Security Service Attention
Dominant language
TypeSpec
Stars
3.1k
Forks
5.9k
Avg merge
2d 22h
Merged PRs (30d)
444

Description

# Bug Report

After [creating Security Center Workspace settings](https://docs.microsoft.com/en-us/rest/api/securitycenter/workspacesettings/create), the operation completes but when [getting the settings](https://docs.microsoft.com/en-us/rest/api/securitycenter/workspacesettings/get) subsequently, the `workspaceId` property is missing from the response.

## Create

```http
PUT /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/workspaceSettings/default?api-version=2017-08-01-preview HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.16 (amd64-darwin) go-autorest/v14.2.1 Azure-SDK-For-Go/v53.4.0 Terraform Plugin SDK/1.17.1 terraform-provider-azurerm/acc
Content-Length: 273
Authorization: Bearer redacted
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: af87d0b1-a4ed-9553-4c3b-7ea1b63d0b1a
Accept-Encoding: gzip

{
"properties": {
"workspaceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestRG-sc-210426223947256945/providers/Microsoft.OperationalInsights/workspaces/acctest-210426223947256945-1",
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}
}
```
```http
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
x-ms-request-id: 66edc69b-b3f0-425e-83c4-703362642cbf
Server: Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-resource-requests: 249
x-ms-correlation-request-id: af87d0b1-a4ed-9553-4c3b-7ea1b63d0b1a
x-ms-routing-request-id: UKSOUTH:20210426T214123Z:2fbd133f-aef8-4b32-b337-b21b1f3e7058
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Date: Mon, 26 Apr 2021 21:41:23 GMT

{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/workspaceSettings/default",
"name": "default",
"type": "Microsoft.Security/workspaceSettings",
"properties": {
"workspaceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/acctestRG-sc-210426223947253749/providers/Microsoft.OperationalInsights/workspaces/acctest-210426223947253749-1",
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}
}
```

## Get

```http
GET /subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/workspaceSettings/default?api-version=2017-08-01-preview HTTP/1.1
Host: management.azure.com
User-Agent: Go/go1.16 (amd64-darwin) go-autorest/v14.2.1 Azure-SDK-For-Go/v53.4.0 Terraform Plugin SDK/1.17.1 terraform-provider-azurerm/acc
Authorization: Bearer redacted
X-Ms-Correlation-Request-Id: af87d0b1-a4ed-9553-4c3b-7ea1b63d0b1a
Accept-Encoding: gzip
```
```http
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8
Content-Encoding: gzip
Expires: -1
Vary: Accept-Encoding
x-ms-request-id: 5af22b18-93eb-4b59-aa01-6bcf54d10b0b
Server: Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-resource-requests: 731
x-ms-correlation-request-id: af87d0b1-a4ed-9553-4c3b-7ea1b63d0b1a
x-ms-routing-request-id: UKSOUTH:20210426T220109Z:0d8a3e96-7d56-4bdd-a2a3-9b1fbcd1fcf2
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Content-Type-Options: nosniff
Date: Mon, 26 Apr 2021 22:01:08 GMT

{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Security/workspaceSettings/default",
"name": "default",
"type": "Microsoft.Security/workspaceSettings",
"properties": {
"scope": "/subscriptions/00000000-0000-0000-0000-000000000000"
}
}```

Contributor guide

Open the contributing guide

Research direction

Inspect the Microsoft.Security workspaceSettings API specification and compare the documented PUT and GET behavior shown in the report. Reproduce the create-then-get sequence if possible; the issue is done when the GET response preserves the properties.workspaceId value returned after creation.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.