File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/ResourceManager/Compute/Commands.Compute/Extension/AzureDiskEncryption Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -231,6 +231,20 @@ public override void ExecuteCmdlet()
231
231
232
232
currentOSType = virtualMachineResponse . StorageProfile . OsDisk . OsType ;
233
233
234
+ if ( OperatingSystemTypes . Linux . Equals ( currentOSType ) &&
235
+ ! AzureDiskEncryptionExtensionContext . VolumeTypeData . Equals ( VolumeType , StringComparison . InvariantCultureIgnoreCase ) )
236
+ {
237
+ ThrowTerminatingError (
238
+ new ErrorRecord (
239
+ new ArgumentException (
240
+ string . Format (
241
+ CultureInfo . CurrentUICulture ,
242
+ "Disabling encryption is only allowed on Data volumes for Linux VMs." ) ) ,
243
+ "InvalidType" ,
244
+ ErrorCategory . NotImplemented ,
245
+ null ) ) ;
246
+ }
247
+
234
248
if ( this . ShouldProcess ( VMName , Properties . Resources . DisableDiskEncryptionAction )
235
249
&& ( this . Force . IsPresent ||
236
250
this . ShouldContinue ( Properties . Resources . DisableAzureDiskEncryptionConfirmation , Properties . Resources . DisableAzureDiskEncryptionCaption ) ) )
You can’t perform that action at this time.
0 commit comments