Azure / Azure/azure-rest-api-specs
[BUG] AAD: DiagnosticSettings GET API may return a 404 error After a successful PUT
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://github.com/Azure/azure-rest-api-specs/blob/60bcde388a845febb60fc2bda17983ca59af219a/specification/azureactivedirectory/resource-manager/Microsoft.Aadiam/AzureActiveDirectory/stable/2017-04-01/azureactivedirectory.json#L106
### API Spec version
2017-04-01
### Describe the bug
AAD: DiagnosticSettings GET API may return a 404 error After a successful (200) PUT
### Expected behavior
GET should return 200 after a PUT (200)
### Actual behavior
GET API may return a 404 error After a successful (200) PUT
### Reproduction Steps
[DEBUG] AzureRM Request:
GET /providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01 HTTP/1.1
Host: management.azure.com
User-Agent: HashiCorp/go-azure-sdk (Go-http-Client/1.1 diagnosticsettings/2017-04-01) HashiCorp Terraform/1.13.3 (+https://www.terraform.io) terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 240b74de-b10a-da4b-1eb1-cbfb2004121d
Accept-Encoding: gzip
[DEBUG] GET https://management.azure.com/providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01
[DEBUG] AzureRM Response for https://management.azure.com/providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01:
HTTP/2.0 404 Not Found
Content-Length: 113
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Wed, 08 Oct 2025 20:17:05 GMT
Expires: -1
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Cache: CONFIG_NOCACHE
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 240b74de-b10a-da4b-1eb1-cbfb2004121d
X-Ms-Operation-Identifier:
X-Ms-Ratelimit-Remaining-Tenant-Reads: 249
X-Ms-Request-Id: 00000000-0000-0000-0000-000000000000
X-Ms-Routing-Request-Id: WESTUS:20251008T201705Z:394134a6-74e4-4dec-95e0-9518af745a5f
X-Msedge-Ref: Ref A: CCAF7F7DD7F84799A81A5462F31C25F1 Ref B: YQ1AA2090601023 Ref C: 2025-10-08T20:17:05Z
{"code":"ResourceNotFound","message":"The diagnostic setting 'evh-entid-diag-test-pxRZb76eC6F3p' doesn't exist."}
[DEBUG] AzureRM Request:
PUT /providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01 HTTP/1.1
Host: management.azure.com
User-Agent: HashiCorp/go-azure-sdk (Go-http-Client/1.1 diagnosticsettings/2017-04-01) HashiCorp Terraform/1.13.3 (+https://www.terraform.io) terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 608
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 240b74de-b10a-da4b-1eb1-cbfb2004121d
Accept-Encoding: gzip
{"properties":{"eventHubAuthorizationRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-entid-diag-test-hIj5h42etFhFa/providers/Microsoft.EventHub/namespaces/evhns-entid-diag-test-Uw9VqmJbj6nhP/authorizationRules/rule-entid-diag-test","eventHubName":"evh-entid-diag-test","logs":[{"category":"ServicePrincipalSignInLogs","enabled":true},{"category":"SignInLogs","enabled":true},{"category":"ADFSSignInLogs","enabled":true},{"category":"NonInteractiveUserSignInLogs","enabled":true},{"category":"ManagedIdentitySignInLogs","enabled":true},{"category":"AuditLogs","enabled":true}]}}
[DEBUG] PUT https://management.azure.com/providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01
[DEBUG] AzureRM Response for https://management.azure.com/providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01:
HTTP/2.0 200 OK
Content-Length: 1352
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Wed, 08 Oct 2025 20:17:08 GMT
Expires: -1
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Cache: CONFIG_NOCACHE
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 240b74de-b10a-da4b-1eb1-cbfb2004121d
X-Ms-Operation-Identifier:
X-Ms-Ratelimit-Remaining-Tenant-Writes: 199
X-Ms-Request-Id: 52c3d754-52f8-4ddc-a032-197797c9aefc
X-Ms-Routing-Request-Id: CANADACENTRAL:20251008T201708Z:96973875-e60f-451f-9cb9-521afeab48b4
X-Msedge-Ref: Ref A: E796E36EE1044871BAB987325E89C004 Ref B: YQ1AA2090602062 Ref C: 2025-10-08T20:17:06Z
{"id":"providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p","type":"Microsoft.Insights/diagnosticSettings","name":"evh-entid-diag-test-pxRZb76eC6F3p","location":null,"kind":null,"tags":null,"properties":{"storageAccountId":null,"serviceBusRuleId":null,"workspaceId":null,"eventHubAuthorizationRuleId":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg-entid-diag-test-hIj5h42etFhFa/providers/Microsoft.EventHub/namespaces/evhns-entid-diag-test-Uw9VqmJbj6nhP/authorizationRules/rule-entid-diag-test","eventHubName":"evh-entid-diag-test","metrics":[],"logs":[{"category":"ServicePrincipalSignInLogs","categoryGroup":null,"enabled":true,"retentionPolicy":{"enabled":false,"days":0}},{"category":"SignInLogs","categoryGroup":null,"enabled":true,"retentionPolicy":{"enabled":false,"days":0}},{"category":"ADFSSignInLogs","categoryGroup":null,"enabled":true,"retentionPolicy":{"enabled":false,"days":0}},{"category":"NonInteractiveUserSignInLogs","categoryGroup":null,"enabled":true,"retentionPolicy":{"enabled":false,"days":0}},{"category":"ManagedIdentitySignInLogs","categoryGroup":null,"enabled":true,"retentionPolicy":{"enabled":false,"days":0}},{"category":"AuditLogs","categoryGroup":null,"enabled":true,"retentionPolicy":{"enabled":false,"days":0}}],"logAnalyticsDestinationType":null},"identity":null}
[DEBUG] AzureRM Request:
GET /providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01 HTTP/1.1
Host: management.azure.com
User-Agent: HashiCorp/go-azure-sdk (Go-http-Client/1.1 diagnosticsettings/2017-04-01) HashiCorp Terraform/1.13.3 (+https://www.terraform.io) terraform-provider-azurerm/dev pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Type: application/json; charset=utf-8
X-Ms-Correlation-Request-Id: 240b74de-b10a-da4b-1eb1-cbfb2004121d
Accept-Encoding: gzip
[DEBUG] GET https://management.azure.com/providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01
[DEBUG] AzureRM Response for https://management.azure.com/providers/Microsoft.AADIAM/diagnosticSettings/evh-entid-diag-test-pxRZb76eC6F3p?api-version=2017-04-01:
HTTP/2.0 404 Not Found
Content-Length: 113
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Wed, 08 Oct 2025 20:17:08 GMT
Expires: -1
Pragma: no-cache
Strict-Transport-Security: max-age=31536000; includeSubDomains
X-Cache: CONFIG_NOCACHE
X-Content-Type-Options: nosniff
X-Ms-Correlation-Request-Id: 240b74de-b10a-da4b-1eb1-cbfb2004121d
X-Ms-Operation-Identifier:
X-Ms-Ratelimit-Remaining-Tenant-Reads: 249
X-Ms-Request-Id: 00000000-0000-0000-0000-000000000000
X-Ms-Routing-Request-Id: WESTUS:20251008T201708Z:71f40eca-6565-483d-bf60-af47efe42f96
X-Msedge-Ref: Ref A: EF099FA3A55D4DCDAEA1101D4EC87C07 Ref B: YQ1AA2090602054 Ref C: 2025-10-08T20:17:08Z
{"code":"ResourceNotFound","message":"The diagnostic setting 'evh-entid-diag-test-pxRZb76eC6F3p' doesn't exist."}
### Environment
https://github.com/hashicorp/terraform-provider-azurerm/issues/30808
Contributor guide
Research direction
Start with the linked azureactivedirectory.json definition at the diagnosticSettings GET operation and review the reproduction and related Terraform issue. Verify the PUT-then-GET sequence against the 2017-04-01 API, then document whether the specification needs correction or the behavior must be escalated as a service issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100