Closed ellismg closed 2 weeks ago
I want to write a small regression test here with a baseline because this stuff is tricky enough, but locally this fixed the issue, so I wanted to get the code change up so I could get privates.
I want to write a small regression test here with a baseline because this stuff is tricky enough, but locally this fixed the issue, so I wanted to get the code change up so I could get privates.
Added this as a case to an existing test around bicep generation.
May elevate using
sudo
on some platforms and configurations
bash:
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847/uninstall-azd.sh | bash;
curl -fsSL https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847/install-azd.sh | bash -s -- --base-url https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847 --version '' --verbose --skip-verify
pwsh:
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847/uninstall-azd.ps1' -OutFile uninstall-azd.ps1; ./uninstall-azd.ps1
Invoke-RestMethod 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847/install-azd.ps1' -OutFile install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847' -Version '' -SkipVerify -Verbose
PowerShell install
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847/uninstall-azd.ps1' > uninstall-azd.ps1; ./uninstall-azd.ps1;"
powershell -c "Set-ExecutionPolicy Bypass Process; irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847/install-azd.ps1' > install-azd.ps1; ./install-azd.ps1 -BaseUrl 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847' -Version '' -SkipVerify -Verbose;"
MSI install
powershell -c "irm 'https://azuresdkreleasepreview.blob.core.windows.net/azd/standalone/pr/3847/azd-windows-amd64.msi' -OutFile azd-windows-amd64.msi; msiexec /i azd-windows-amd64.msi /qn"
LGTM! I was worried from the issue description that this would end up being a bigger change. Cool that this ended up being a simple fix, a good indicator of well modeled code.
I was actually concerned about this too at first, @weikanglim, and a tad nervous because it was a while since I had been in this part of the code. The groundwork that @vhvb1989 laid when he was doing the bicep module stuff really worked out well here, the emit type pattern felt really nice. I was actually shocked at first thinking "really, that's all I needed to do?"
We were not taking the emitType flag into account when generating values for
.host
or.url
binding expressions and just always emited the yaml format. This caused invalid bicep generation when a module would have a pramater with a value like${project.bindings.https.url}
.Fixes #3839