ResourceModules icon indicating copy to clipboard operation
ResourceModules copied to clipboard

[Bug Report]: Log Analytics workspaces etag field not valid

Open itpropro opened this issue 3 years ago • 5 comments

Describe the bug

When deploying a log analytics workspace using the Microsoft.OperationalInsights/workspaces module, the following warning appears: E:\repos\test\modules\carml\0.5.0\Microsoft.OperationalInsights\workspaces\savedSearches\deploy.bicep(55,5) : Warning BCP037: The property "etag" is not allowed on objects of type "SavedSearchProperties". No other properties are allowed. If this is an inaccuracy in the documentation, please report it to the Bicep Team. [https://aka.ms/bicep-type-issues]

If this can be confirmed to be an error, it should be enough to remove the following lines: https://github.com/Azure/ResourceModules/blob/7eaa7edfc07f7db4fe5e255f07ebc22175777918/arm/Microsoft.OperationalInsights/workspaces/deploy.bicep#L206 https://github.com/Azure/ResourceModules/blob/7eaa7edfc07f7db4fe5e255f07ebc22175777918/arm/Microsoft.OperationalInsights/workspaces/savedSearches/deploy.bicep#L55

To reproduce

Deploy a log analytics workspace using the Microsoft.OperationalInsights/workspaces module.

Code snippet

No response

Relevant log output

No response

itpropro avatar Jun 21 '22 21:06 itpropro

I'll be happy to leave a PR, if this is a confirmed issue.

itpropro avatar Jun 22 '22 10:06 itpropro

Hey @itpropro, I actually brought this up with the PG some time back.

Long story short, it seems to be a provider inaccuracy. The API tells you to place the etag outside the param block, but if you do that, the deployment doesn't work. It does however inside the block.

This was originally introduced by @SeSeicht in this PR: #1413.

AlexanderSehr avatar Jun 23 '22 09:06 AlexanderSehr

I can confirm that moving the etag inside the properties object does allow a deployment, the warning is definitely incorrect. Adding the etag property allows me to redeploy the hunting rule without any errors in Azure.

Couple screenshots if they help. image

image

justinkhart avatar Jun 24 '22 05:06 justinkhart

Thanks for the explanation, where is the issue tracked with the Bicep team @MrMCake ?

itpropro avatar Jun 25 '22 12:06 itpropro

Hey @itpropro , I raised the issue in the 'offical' "Missing type validation / inaccuracies" issue here (just expand Microsoft.OperationalInsights/workspaces/savedSearches).

There have also been a couple comments to it underneath.

AlexanderSehr avatar Jun 25 '22 18:06 AlexanderSehr

I'll go ahead and close this issue here as fixing it appears to be outside of CARML's reach and something either the ARM/Bicep PG or the Provider-PG have to fix on their end.

AlexanderSehr avatar Sep 09 '22 09:09 AlexanderSehr