Azure / Azure/arm-template-whatif

Delta Before/After not populated for some changes.

Open
#283 0 comments 0 reactions 0 assignees View on GitHub
Needs Triage :mag:
Dominant language
HTML
Stars
101
Forks
21
Avg merge
3h 35m
Merged PRs (30d)
1

Description

**Describe the bug**
Delta Before/After info does not show on the WhatIfResult object

**To Reproduce**
Before Template
```bicep
param location string = resourceGroup().location
resource sa 'Microsoft.Storage/storageAccounts@2022-05-01' = {
name: 'jwgdeltatest'
location: location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
properties: {
supportsHttpsTrafficOnly: false
}
tags: {
deltaTest: 'ChangeMe'
}

}

```

After Template
```bicep
param location string = resourceGroup().location
resource sa 'Microsoft.Storage/storageAccounts@2022-05-01' = {
name: 'jwgdeltatest'
location: location
kind: 'StorageV2'
sku: {
name: 'Standard_LRS'
}
properties: {
supportsHttpsTrafficOnly: false
}
tags: {
deltaTest: 'Changed'
}

}

```

DeltaTest property changed from "ChangeMe" to "Changed"

**Expected behavior**
Path tags.deltaTest should have Before as `ChangeMe` and After as `Changed` but they are null instead.
![image](https://user-images.githubusercontent.com/15258962/191376336-00d810a6-76ff-4d82-af17-0d740f596b44.png)

Per below, it still shows in the formatted WhatIf output, so where is it pulling from? Is it calculating directly on the JSON? Regardless this object field should be populated.

**Screenshots**
```
The deployment will update the following scope:

Scope: /subscriptions/52487fb1-7325-4ec9-9bb0-a9079e62d255/resourceGroups/AzureWhatIfFilter-dev

~ Microsoft.Storage/storageAccounts/jwgdeltatest [2022-05-01]
~ tags.deltaTest: "ChangeMe" => "Changed"

Resource changes: 1 to modify.
```

**Client** [e.g. PowerShell, CLI, API)

**Additional context**
Add any other context about the problem here.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the WhatIfResult object and trace how the formatted WhatIf output obtains the tags.deltaTest change. Compare that path with the population of Before and After, then reproduce the supplied Bicep change to verify both values are present.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.