az deployment sub what-if shows that Microsoft.Elastic resource has changed but it doesn't
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
**Related command**
`az deployment sub what-if --location northeurope --template-file main.bicep`
`az deployment sub create` as well
part of the elasticCloud bicep template:
```
resource elasticCloud 'Microsoft.Elastic/monitors@2022-09-01-preview' = {
name: 'test1301910940'
location: northeurope
properties: {
userInfo: {
emailAddress: "test@microsoft.com" // sample email
}
}
sku: {
name: 'ess-monthly-consumption_Monthly'
}
}
```
**Describe the bug**
If the resource was already created `az deployment sub what-if` always reports the `properties.userInfo emailAddress` as a changed property.

Accordingly, `az deployment sub create` tries to modify the elastic cluster and fails.
**To Reproduce**
1) [Create elastic monitor]( https://learn.microsoft.com/en-us/cli/azure/elastic/monitor?view=azure-cli-latest#az-elastic-monitor-create) with provided emailAddress (--user-info parameter)
2) Prepare [Microsoft.Elastic/monitors](https://learn.microsoft.com/en-us/azure/templates/microsoft.elastic/monitors?pivots=deployment-language-bicep) bicep template with a provided `emailAddress` from the previous step.
3) Run `az deployment sub what-if` with the template from the previous step.
**Expected behavior**
Expected to see a `no changes` what-if result but receive `1 to modify`.
**Environment summary**
ElasticCloud resource version - `Microsoft.Elastic/monitors@2022-09-01-preview`
**Additional context**
Contributor guide
Assessment
This issue has not been assessed yet.