Azure / Azure/azure-rest-api-specs
Microsoft.OperationalInsights/workspaces/savedSearches eTag inconsistency
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
Documentation and API spec for savedSearches states that eTag is a resource property but deployment via ARM template fails unless it is defined as a saved search property. VS code ARM Template extension also flags eTag under the resource is not a valid property.
[Documentation Link](https://learn.microsoft.com/en-us/azure/templates/microsoft.operationalinsights/workspaces/savedsearches?pivots=deployment-language-arm-template)
[API Spec](https://github.com/Azure/azure-rest-api-specs/blob/main/specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SavedSearches.json)
Working Example:
`{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"WorkspaceName": {
"type": "string"
},
"WorkspaceLocation": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"name": "[concat(parameters('WorkspaceName'), '/ArubaClearPass')]",
"apiVersion": "2020-08-01",
"type": "Microsoft.OperationalInsights/workspaces/savedSearches",
"location": "[parameters('WorkspaceLocation')]",
"properties": {
"eTag": "*",
"displayName": "ArubaClearPass",
"category": "Samples",
"functionAlias": "ArubaClearPass",
"query": "Trimmed for readability "
}
}
]
}`
Deployment with the example below fails with the following error:
> The request content was invalid and could not be deserialized: 'Could not find member 'etag' on object of type 'TemplateResource'. Path 'properties.template.resources[0].etag'
`{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"WorkspaceName": {
"type": "string"
},
"WorkspaceLocation": {
"type": "string"
}
},
"variables": {},
"resources": [
{
"name": "[concat(parameters('WorkspaceName'), '/ArubaClearPass')]",
"apiVersion": "2020-08-01",
"type": "Microsoft.OperationalInsights/workspaces/savedSearches",
"location": "[parameters('WorkspaceLocation')]",
"eTag": "*",
"properties": {
"displayName": "ArubaClearPass",
"category": "Samples",
"functionAlias": "ArubaClearPass",
"query": "Trimmed for readability "
}
}
]
}`
Contributor guide
Research direction
Start with specification/operationalinsights/resource-manager/Microsoft.OperationalInsights/stable/2020-08-01/SavedSearches.json and compare its eTag placement with the linked ARM template documentation. Reproduce the two deployment shapes described in the issue and update the API spec or documentation so the schema, extension validation, and working deployment agree.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 42/100