Skip to content

AzureDiskEncryptionPreRequisiteSetup.ps1 doesn't handle regions with spaces in name #6269

@thwpike

Description

@thwpike

Description

When trying to enable Azure Disk Encryption, the the Virtual machine reports its' region without a space, whilst the keyVault does resulting in the following error:

To enable AzureDiskEncryption, VM and KeyVault must belong to same subscription and same region. vm Location:  australiaeast , keyVault Location: australia east
At line:235 char:182
+ ... ion.ToLower()) , keyVault Location: $($keyVault.Location.ToLower())";
+                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException

This appears to be an issue with this line which should also strip any spaces from the comparison.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions