Azure / Azure/arm-template-whatif
WhatIf always displaying "no change" when using functions in uri path
- Dominant language
- HTML
- Stars
- 101
- Forks
- 21
- Avg merge
- 3h 35m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
We're using a quite complex way of calculating the path of the linked template to use. The what-if always returns "no change".
If I hard-code in the template the result of the calculation, the what-if is instead successful.
Example of non-working:
"uri": "[concat(variables('modulesPath'), 'ResourceGroup/1.0.74/deploy.json', if(parameters('componentsStorageContainerIsPrivate'), concat('?', listAccountSas(parameters('componentStorageAccountId'), '2019-04-01', variables('accountSasProperties')).accountSasToken), ''))]",
Same template, with hard-coded value & working
"uri": "https://iacs.blob.core.windows.net/components/Modules/ARM/ResourceGroup/1.0.74/deploy.json?",
**To Reproduce**
Examples in the attached file: [whatiftest.zip](https://github.com/Azure/arm-template-whatif/files/6063588/whatiftest.zip)
1. Store a template (deploy.json in the attachment) in a storage account. Container should be private
2. Create a template linking the template stored in the storage account (use whatiftest.json and parameters.json in the attachment)
3. Try the whatif deploying the template (whatiftest.json)
4. Use the hard-coded value and verify the whatif works
**Expected behavior**
Same result in (3) and (4)
**Client** [e.g. PowerShell, CLI, API)
PowerShell 7.1.2
Az.Resources 3.2.1
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the attached whatiftest.zip, especially deploy.json, whatiftest.json, and parameters.json, and reproduce the deployment using PowerShell 7.1.2 with Az.Resources 3.2.1. Compare the function-based URI with the hard-coded URI during what-if. Done means both forms produce the same what-if result rather than reporting no change.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100