Azure / Azure/azure-cli

az deployment sub what-if shows that Microsoft.Elastic resource has changed but it doesn't

Open
#26,031 3 comments 0 reactions 1 assignee Claimed by @zhoxing-ms View on GitHub
act-identity-squad ARM Auto-Assign customer-reported question Service Attention
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.
![image](https://user-images.githubusercontent.com/37839190/229502763-7f3a986c-6731-4cc2-b310-d9bec1919e2c.png)
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.