Azure / Azure/azure-quickstart-templates
ADE Update Template RG Reference
- Dominant language
- Bicep
- Stars
- 14.9k
- Forks
- 16.2k
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 6
Description
[Encrypt Running Windows VM](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/201-encrypt-running-windows-vm/updatevm-nokek.json)
### Issue Details
So I could certainly be missing something, and I'll gladly back track if that's the case, but I think there is a pretty big issue with how this template is currently written. This template (as well as the .../updatevm-kek.json) version is referenced by several other templates so there is a pretty big impact for any changes.
My understanding is that the location of your **keyvault** and **VM** must match for Azure Disk Encryption. As far as I know, the location of your resource group should not impact any of this. In terms of the high level process for Template Based ADE:
1) Build your VM (and disk)
2) Add the ADE Extension to the disk
3) Run a resource to update the VM object's disk "encryption" attribute
Number 3, or the update VM template is where I see the issue. If I have a resource group in East US and I am deploying a VM (server1) in WestUS when the update VM occurs, the template looks to update "server1" located in EastUS. The response returned is "The resource 'server1' already exists in location 'westus'
in resource group '_________'. A resource with the same name cannot be
created in location 'eastus'. Please select a new resource name"
While this is not an issue for RGs whose location matches the VM, I think that the template needs to be corrected to reference the location of the VM rather than the resource group. You could pass this as a parameter or maybe through another resource reference function.
Feel free to reach out for clarification! -bebattis
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with 201-encrypt-running-windows-vm/updatevm-nokek.json and compare the corresponding updatevm-kek.json template. Trace how the update VM resource gets its location and verify the behavior when the resource group and VM use different regions. Done means both update templates deploy without attempting to recreate the VM in the resource group’s location.
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
- 35/100