Imported resources via resourceId, produces hardcoded Environment URLs
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 81
Description
**Bicep version**
0.4.1090
**Describe the bug**
Using ctrl+shift+p and then importing from resourceId is an excellent option for importing existing resources. I was expecting the function to use environment() where needed.
Was expecting something like this;
```
bootDiagnostics: {
enabled: true
storageUri: 'https://test123.blob.${environment().suffixes.storage}'
}
```
Instead it produces this (and the linter gives a warning);
```
bootDiagnostics: {
enabled: true
storageUri: 'https://test123.blob.core.windows.net'
}
```
Not a big deal, but if using this in a large scale it would be nice avoid having to modify this after the import.
**To Reproduce**
Try importing ane resource that has a URI (i.e a VM with diagnostics)
Contributor guide
Research direction
Start with the Ctrl+Shift+P import-from-resourceId flow, reproducing the case with a VM that has boot diagnostics and a storage URI. Trace how the generated URI is formed; done means imported resources use environment().suffixes.storage where appropriate instead of a hardcoded endpoint, without the linter warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100