diff --git a/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py b/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py index 079fab57b30..bcd78e706d5 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py +++ b/src/azure-cli/azure/cli/command_modules/vm/_vm_utils.py @@ -105,11 +105,16 @@ def check_existence(cli_ctx, value, resource_group, provider_namespace, resource return False -def create_keyvault_data_plane_client(cli_ctx, vault_base_url): +def create_data_plane_keyvault_certificate_client(cli_ctx, vault_base_url): from azure.cli.command_modules.keyvault._client_factory import data_plane_azure_keyvault_certificate_client return data_plane_azure_keyvault_certificate_client(cli_ctx, {"vault_base_url": vault_base_url}) +def create_data_plane_keyvault_key_client(cli_ctx, vault_base_url): + from azure.cli.command_modules.keyvault._client_factory import data_plane_azure_keyvault_key_client + return data_plane_azure_keyvault_key_client(cli_ctx, {"vault_base_url": vault_base_url}) + + def get_key_vault_base_url(cli_ctx, vault_name): suffix = cli_ctx.cloud.suffixes.keyvault_dns return 'https://{}{}'.format(vault_name, suffix) diff --git a/src/azure-cli/azure/cli/command_modules/vm/custom.py b/src/azure-cli/azure/cli/command_modules/vm/custom.py index 2eaf8d7397f..29a1a66df38 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/custom.py +++ b/src/azure-cli/azure/cli/command_modules/vm/custom.py @@ -2894,13 +2894,13 @@ def get_vm_format_secret(cmd, secrets, certificate_store=None, keyvault=None, re def add_vm_secret(cmd, resource_group_name, vm_name, keyvault, certificate, certificate_store=None): from msrestazure.tools import parse_resource_id - from ._vm_utils import create_keyvault_data_plane_client, get_key_vault_base_url + from ._vm_utils import create_data_plane_keyvault_certificate_client, get_key_vault_base_url VaultSecretGroup, SubResource, VaultCertificate = cmd.get_models( 'VaultSecretGroup', 'SubResource', 'VaultCertificate') vm = get_vm_to_update(cmd, resource_group_name, vm_name) if '://' not in certificate: # has a cert name rather a full url? - keyvault_client = create_keyvault_data_plane_client( + keyvault_client = create_data_plane_keyvault_certificate_client( cmd.cli_ctx, get_key_vault_base_url(cmd.cli_ctx, parse_resource_id(keyvault)['name'])) cert_info = keyvault_client.get_certificate(certificate) certificate = cert_info.secret_id diff --git a/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py b/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py index d3384c6a417..4f57d799408 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py +++ b/src/azure-cli/azure/cli/command_modules/vm/disk_encryption.py @@ -10,7 +10,7 @@ from azure.cli.core.commands import LongRunningOperation from azure.cli.command_modules.vm.custom import set_vm, _compute_client_factory, _is_linux_os -from azure.cli.command_modules.vm._vm_utils import get_key_vault_base_url, create_keyvault_data_plane_client +from azure.cli.command_modules.vm._vm_utils import get_key_vault_base_url, create_data_plane_keyvault_key_client _DATA_VOLUME_TYPE = 'DATA' _ALL_VOLUME_TYPE = 'ALL' @@ -363,9 +363,9 @@ def show_vm_encryption_status(cmd, resource_group_name, vm_name): def _get_keyvault_key_url(cli_ctx, keyvault_name, key_name): vault_base_url = get_key_vault_base_url(cli_ctx, keyvault_name) - client = create_keyvault_data_plane_client(cli_ctx, vault_base_url) - result = client.get_key(key_name) - return result.key.kid # pylint: disable=no-member + client = create_data_plane_keyvault_key_client(cli_ctx, vault_base_url) + key = client.get_key(key_name) + return key.id def _handles_default_volume_type_for_vmss_encryption(is_linux, volume_type, force): diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_encryption_with_key.yaml b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_encryption_with_key.yaml new file mode 100644 index 00000000000..0aecfe8d1b9 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/recordings/test_vm_disk_encryption_with_key.yaml @@ -0,0 +1,2464 @@ +interactions: +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001","name":"cli_test_vm_encryption000001","type":"Microsoft.Resources/resourceGroups","location":"eastus2","tags":{"product":"azurecli","cause":"automation","test":"test_vm_disk_encryption_with_key","date":"2023-09-28T07:41:31Z","module":"vm"},"properties":{"provisioningState":"Succeeded"}}' + headers: + cache-control: + - no-cache + content-length: + - '391' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:34 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\": + {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"type\": + \"object\",\n \"value\": {\n \"Linux\": {\n \"CentOS\": + {\n \"publisher\": \"OpenLogic\",\n \"offer\": \"CentOS\",\n + \ \"sku\": \"7.5\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"CentOS85Gen2\": {\n \"publisher\": + \ \"OpenLogic\",\n \"offer\": \"CentOS\",\n \"sku\": + \ \"8_5-gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Debian\": {\n \"publisher\": + \"Debian\",\n \"offer\": \"debian-10\",\n \"sku\": \"10\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Debian11\": {\n \"publisher\": \"Debian\",\n + \ \"offer\": \"debian-11\",\n \"sku\": \"11-backports-gen2\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n + \ \"offer\": \"flatcar-container-linux-free\",\n \"sku\": + \"stable\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"FlatcarLinuxFreeGen2\": {\n \"publisher\": + \ \"kinvolk\",\n \"offer\": \"flatcar-container-linux-free\",\n + \ \"sku\": \"stable-gen2\",\n \"version\": \"latest\",\n + \ \"architecture\": \"x64\"\n },\n \"openSUSE-Leap\": + {\n \"publisher\": \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n + \ \"sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"OpenSuseLeap154Gen2\": {\n \"publisher\": + \ \"SUSE\",\n \"offer\": \"openSUSE-leap-15-4\",\n \"sku\": + \ \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"RHEL\": {\n \"publisher\": \"RedHat\",\n + \ \"offer\": \"RHEL\",\n \"sku\": \"7-LVM\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"RHELRaw8LVMGen2\": + \ {\n \"publisher\": \"RedHat\",\n \"offer\": \"RHEL\",\n + \ \"sku\": \"8-lvm-gen2\",\n \"version\": \"latest\",\n + \ \"architecture\": \"x64\"\n },\n \"SLES\": {\n + \ \"publisher\": \"SUSE\",\n \"offer\": \"sles-15-sp3\",\n + \ \"sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"SuseSles15SP3\": {\n \"publisher\": + \"SUSE\",\n \"offer\": \"sles-15-sp3\",\n \"sku\": \"gen2\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"UbuntuLTS\": {\n \"publisher\": \"Canonical\",\n + \ \"offer\": \"UbuntuServer\",\n \"sku\": \"18.04-LTS\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Ubuntu2204\": {\n \"publisher\": \"Canonical\",\n + \ \"offer\": \"0001-com-ubuntu-server-jammy\",\n \"sku\": + \ \"22_04-lts-gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n },\n \"Windows\": {\n \"Win2022Datacenter\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-Datacenter\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"Win2022AzureEditionCore\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-datacenter-azure-edition-core\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Win2019Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2019-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2016Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2016-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-R2-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2008-R2-SP1\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n }\n }\n }\n }\n}\n" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '5018' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + cross-origin-resource-policy: + - cross-origin + date: + - Thu, 28 Sep 2023 07:42:35 GMT + etag: + - W/"0a553f088c358b909a2940b5a97fcb731c1d443cb7a332ca4933eb2b7df38468" + expires: + - Thu, 28 Sep 2023 07:47:35 GMT + source-age: + - '18' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - 3bbf38fb705f5c2552ecb116fa36a2d3c954ae1c + x-frame-options: + - deny + x-github-request-id: + - 39E0:0375:3613FF:40D1D1:650F9698 + x-served-by: + - cache-qpg1281-QPG + x-timer: + - S1695886955.027377,VS0,VE1 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2012-Datacenter/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"eastus2\",\r\n \"name\": \"9200.24462.230825\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2012-Datacenter/Versions/9200.24462.230825\"\r\n + \ }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '312' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:36 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15999,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43986 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2012-Datacenter/versions/9200.24462.230825?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n \"disallowed\": {\r\n + \ \"vmDiskType\": \"None\"\r\n },\r\n \"automaticOSUpgradeProperties\": + {\r\n \"automaticOSUpgradeSupported\": false\r\n },\r\n \"imageDeprecationStatus\": + {\r\n \"imageState\": \"Active\"\r\n },\r\n \"features\": [\r\n + \ {\r\n \"name\": \"IsAcceleratedNetworkSupported\",\r\n \"value\": + \"False\"\r\n },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n + \ \"value\": \"SCSI\"\r\n },\r\n {\r\n \"name\": \"IsHibernateSupported\",\r\n + \ \"value\": \"False\"\r\n }\r\n ],\r\n \"osDiskImage\": + {\r\n \"operatingSystem\": \"Windows\",\r\n \"sizeInBytes\": 136367309312\r\n + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"eastus2\",\r\n + \ \"name\": \"9200.24462.230825\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2012-Datacenter/Versions/9200.24462.230825\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1051' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:37 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12999,Microsoft.Compute/GetVMImageFromLocation30Min;73987 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/virtualNetworks?api-version=2022-01-01 + response: + body: + string: '{"value":[]}' + headers: + cache-control: + - no-cache + content-length: + - '12' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:38 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - python-requests/2.31.0 + method: GET + uri: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/arm-compute/quickstart-templates/aliases.json + response: + body: + string: "{\n \"$schema\": \"http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json\",\n + \ \"contentVersion\": \"1.0.0.0\",\n \"parameters\": {},\n \"variables\": + {},\n \"resources\": [],\n \"outputs\": {\n \"aliases\": {\n \"type\": + \"object\",\n \"value\": {\n \"Linux\": {\n \"CentOS\": + {\n \"publisher\": \"OpenLogic\",\n \"offer\": \"CentOS\",\n + \ \"sku\": \"7.5\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"CentOS85Gen2\": {\n \"publisher\": + \ \"OpenLogic\",\n \"offer\": \"CentOS\",\n \"sku\": + \ \"8_5-gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Debian\": {\n \"publisher\": + \"Debian\",\n \"offer\": \"debian-10\",\n \"sku\": \"10\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Debian11\": {\n \"publisher\": \"Debian\",\n + \ \"offer\": \"debian-11\",\n \"sku\": \"11-backports-gen2\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Flatcar\": {\n \"publisher\": \"kinvolk\",\n + \ \"offer\": \"flatcar-container-linux-free\",\n \"sku\": + \"stable\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"FlatcarLinuxFreeGen2\": {\n \"publisher\": + \ \"kinvolk\",\n \"offer\": \"flatcar-container-linux-free\",\n + \ \"sku\": \"stable-gen2\",\n \"version\": \"latest\",\n + \ \"architecture\": \"x64\"\n },\n \"openSUSE-Leap\": + {\n \"publisher\": \"SUSE\",\n \"offer\": \"opensuse-leap-15-3\",\n + \ \"sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"OpenSuseLeap154Gen2\": {\n \"publisher\": + \ \"SUSE\",\n \"offer\": \"openSUSE-leap-15-4\",\n \"sku\": + \ \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"RHEL\": {\n \"publisher\": \"RedHat\",\n + \ \"offer\": \"RHEL\",\n \"sku\": \"7-LVM\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"RHELRaw8LVMGen2\": + \ {\n \"publisher\": \"RedHat\",\n \"offer\": \"RHEL\",\n + \ \"sku\": \"8-lvm-gen2\",\n \"version\": \"latest\",\n + \ \"architecture\": \"x64\"\n },\n \"SLES\": {\n + \ \"publisher\": \"SUSE\",\n \"offer\": \"sles-15-sp3\",\n + \ \"sku\": \"gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"SuseSles15SP3\": {\n \"publisher\": + \"SUSE\",\n \"offer\": \"sles-15-sp3\",\n \"sku\": \"gen2\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"UbuntuLTS\": {\n \"publisher\": \"Canonical\",\n + \ \"offer\": \"UbuntuServer\",\n \"sku\": \"18.04-LTS\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Ubuntu2204\": {\n \"publisher\": \"Canonical\",\n + \ \"offer\": \"0001-com-ubuntu-server-jammy\",\n \"sku\": + \ \"22_04-lts-gen2\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n },\n \"Windows\": {\n \"Win2022Datacenter\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-Datacenter\",\n \"version\": + \"latest\",\n \"architecture\": \"x64\"\n },\n \"Win2022AzureEditionCore\": + {\n \"publisher\": \"MicrosoftWindowsServer\",\n \"offer\": + \"WindowsServer\",\n \"sku\": \"2022-datacenter-azure-edition-core\",\n + \ \"version\": \"latest\",\n \"architecture\": \"x64\"\n + \ },\n \"Win2019Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2019-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2016Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2016-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012R2Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-R2-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2012Datacenter\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2012-Datacenter\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n },\n \"Win2008R2SP1\": {\n \"publisher\": + \"MicrosoftWindowsServer\",\n \"offer\": \"WindowsServer\",\n \"sku\": + \"2008-R2-SP1\",\n \"version\": \"latest\",\n \"architecture\": + \"x64\"\n }\n }\n }\n }\n }\n}\n" + headers: + accept-ranges: + - bytes + access-control-allow-origin: + - '*' + cache-control: + - max-age=300 + connection: + - keep-alive + content-length: + - '5018' + content-security-policy: + - default-src 'none'; style-src 'unsafe-inline'; sandbox + content-type: + - text/plain; charset=utf-8 + cross-origin-resource-policy: + - cross-origin + date: + - Thu, 28 Sep 2023 07:42:38 GMT + etag: + - W/"0a553f088c358b909a2940b5a97fcb731c1d443cb7a332ca4933eb2b7df38468" + expires: + - Thu, 28 Sep 2023 07:47:38 GMT + source-age: + - '21' + strict-transport-security: + - max-age=31536000 + vary: + - Authorization,Accept-Encoding,Origin + via: + - 1.1 varnish + x-cache: + - HIT + x-cache-hits: + - '1' + x-content-type-options: + - nosniff + x-fastly-request-id: + - 82fb3af5139479e7e3049c8ba1852fb313ca71b3 + x-frame-options: + - deny + x-github-request-id: + - 39E0:0375:3613FF:40D1D1:650F9698 + x-served-by: + - cache-qpg1275-QPG + x-timer: + - S1695886959.841235,VS0,VE4 + x-xss-protection: + - 1; mode=block + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2012-Datacenter/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"eastus2\",\r\n \"name\": \"9200.24462.230825\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2012-Datacenter/Versions/9200.24462.230825\"\r\n + \ }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '312' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:39 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15998,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43985 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2012-Datacenter/versions/9200.24462.230825?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n \"disallowed\": {\r\n + \ \"vmDiskType\": \"None\"\r\n },\r\n \"automaticOSUpgradeProperties\": + {\r\n \"automaticOSUpgradeSupported\": false\r\n },\r\n \"imageDeprecationStatus\": + {\r\n \"imageState\": \"Active\"\r\n },\r\n \"features\": [\r\n + \ {\r\n \"name\": \"IsAcceleratedNetworkSupported\",\r\n \"value\": + \"False\"\r\n },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n + \ \"value\": \"SCSI\"\r\n },\r\n {\r\n \"name\": \"IsHibernateSupported\",\r\n + \ \"value\": \"False\"\r\n }\r\n ],\r\n \"osDiskImage\": + {\r\n \"operatingSystem\": \"Windows\",\r\n \"sizeInBytes\": 136367309312\r\n + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"eastus2\",\r\n + \ \"name\": \"9200.24462.230825\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2012-Datacenter/Versions/9200.24462.230825\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1051' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:41 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12998,Microsoft.Compute/GetVMImageFromLocation30Min;73986 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2012-Datacenter/versions?$top=1&$orderby=name%20desc&api-version=2022-11-01 + response: + body: + string: "[\r\n {\r\n \"location\": \"eastus2\",\r\n \"name\": \"9200.24462.230825\",\r\n + \ \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2012-Datacenter/Versions/9200.24462.230825\"\r\n + \ }\r\n]" + headers: + cache-control: + - no-cache + content-length: + - '312' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:42 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/ListVMImagesVersionsFromLocation3Min;15997,Microsoft.Compute/ListVMImagesVersionsFromLocation30Min;43984 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/publishers/MicrosoftWindowsServer/artifacttypes/vmimage/offers/WindowsServer/skus/2012-Datacenter/versions/9200.24462.230825?api-version=2022-11-01 + response: + body: + string: "{\r\n \"properties\": {\r\n \"hyperVGeneration\": \"V1\",\r\n \"architecture\": + \"x64\",\r\n \"replicaType\": \"Unmanaged\",\r\n \"disallowed\": {\r\n + \ \"vmDiskType\": \"None\"\r\n },\r\n \"automaticOSUpgradeProperties\": + {\r\n \"automaticOSUpgradeSupported\": false\r\n },\r\n \"imageDeprecationStatus\": + {\r\n \"imageState\": \"Active\"\r\n },\r\n \"features\": [\r\n + \ {\r\n \"name\": \"IsAcceleratedNetworkSupported\",\r\n \"value\": + \"False\"\r\n },\r\n {\r\n \"name\": \"DiskControllerTypes\",\r\n + \ \"value\": \"SCSI\"\r\n },\r\n {\r\n \"name\": \"IsHibernateSupported\",\r\n + \ \"value\": \"False\"\r\n }\r\n ],\r\n \"osDiskImage\": + {\r\n \"operatingSystem\": \"Windows\",\r\n \"sizeInBytes\": 136367309312\r\n + \ },\r\n \"dataDiskImages\": []\r\n },\r\n \"location\": \"eastus2\",\r\n + \ \"name\": \"9200.24462.230825\",\r\n \"id\": \"/Subscriptions/00000000-0000-0000-0000-000000000000/Providers/Microsoft.Compute/Locations/eastus2/Publishers/MicrosoftWindowsServer/ArtifactTypes/VMImage/Offers/WindowsServer/Skus/2012-Datacenter/Versions/9200.24462.230825\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1051' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:45 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetVMImageFromLocation3Min;12997,Microsoft.Compute/GetVMImageFromLocation30Min;73985 + status: + code: 200 + message: OK +- request: + body: '{"properties": {"template": {"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", "parameters": {"adminPassword": {"type": "securestring", + "metadata": {"description": "Secure adminPassword"}}}, "variables": {}, "resources": + [{"name": "vm1VNET", "type": "Microsoft.Network/virtualNetworks", "location": + "eastus2", "apiVersion": "2015-06-15", "dependsOn": [], "tags": {}, "properties": + {"addressSpace": {"addressPrefixes": ["10.0.0.0/16"]}, "subnets": [{"name": + "vm1Subnet", "properties": {"addressPrefix": "10.0.0.0/24"}}]}}, {"type": "Microsoft.Network/networkSecurityGroups", + "name": "vm1NSG", "apiVersion": "2015-06-15", "location": "eastus2", "tags": + {}, "dependsOn": []}, {"apiVersion": "2022-01-01", "type": "Microsoft.Network/publicIPAddresses", + "name": "vm1PublicIP", "location": "eastus2", "tags": {}, "dependsOn": [], "properties": + {"publicIPAllocationMethod": null}}, {"apiVersion": "2015-06-15", "type": "Microsoft.Network/networkInterfaces", + "name": "vm1VMNic", "location": "eastus2", "tags": {}, "dependsOn": ["Microsoft.Network/virtualNetworks/vm1VNET", + "Microsoft.Network/networkSecurityGroups/vm1NSG", "Microsoft.Network/publicIpAddresses/vm1PublicIP"], + "properties": {"ipConfigurations": [{"name": "ipconfigvm1", "properties": {"privateIPAllocationMethod": + "Dynamic", "subnet": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/virtualNetworks/vm1VNET/subnets/vm1Subnet"}, + "publicIPAddress": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP"}}}], + "networkSecurityGroup": {"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG"}}}, + {"apiVersion": "2022-11-01", "type": "Microsoft.Compute/virtualMachines", "name": + "vm1", "location": "eastus2", "tags": {}, "dependsOn": ["Microsoft.Network/networkInterfaces/vm1VMNic"], + "properties": {"hardwareProfile": {"vmSize": "Standard_DS1_v2"}, "networkProfile": + {"networkInterfaces": [{"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic", + "properties": {"deleteOption": null}}]}, "storageProfile": {"osDisk": {"createOption": + "fromImage", "name": null, "caching": "ReadWrite", "managedDisk": {"storageAccountType": + null}}, "imageReference": {"publisher": "MicrosoftWindowsServer", "offer": "WindowsServer", + "sku": "2012-Datacenter", "version": "latest"}}, "osProfile": {"computerName": + "vm1", "adminUsername": "clitester1", "adminPassword": "[parameters(''adminPassword'')]"}}}], + "outputs": {}}, "parameters": {"adminPassword": {"value": "Test123456789!"}}, + "mode": "incremental"}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + Content-Length: + - '2913' + Content-Type: + - application/json + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/vm_deploy_4BEUNCciZoXyPfxSDZzDvWpTFtOZd86o","name":"vm_deploy_4BEUNCciZoXyPfxSDZzDvWpTFtOZd86o","type":"Microsoft.Resources/deployments","properties":{"templateHash":"13772825678461016857","parameters":{"adminPassword":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Accepted","timestamp":"2023-09-28T07:42:54.9284504Z","duration":"PT0.0008782S","correlationId":"e90da160-3cce-4713-8974-6ebb726a12e9","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus2"]},{"resourceType":"networkSecurityGroups","locations":["eastus2"]},{"resourceType":"publicIPAddresses","locations":["eastus2"]},{"resourceType":"networkInterfaces","locations":["eastus2"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["eastus2"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/virtualNetworks/vm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"}]}}' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/vm_deploy_4BEUNCciZoXyPfxSDZzDvWpTFtOZd86o/operationStatuses/08585057199142565171?api-version=2022-09-01 + cache-control: + - no-cache + content-length: + - '2458' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:56 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585057199142565171?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:42:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585057199142565171?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:43:27 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585057199142565171?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:43:57 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585057199142565171?api-version=2022-09-01 + response: + body: + string: '{"status":"Running"}' + headers: + cache-control: + - no-cache + content-length: + - '20' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:44:28 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/mock-deployment/operationStatuses/08585057199142565171?api-version=2022-09-01 + response: + body: + string: '{"status":"Succeeded"}' + headers: + cache-control: + - no-cache + content-length: + - '22' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:44:58 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-resource/23.1.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/mock-deployment?api-version=2022-09-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Resources/deployments/vm_deploy_4BEUNCciZoXyPfxSDZzDvWpTFtOZd86o","name":"vm_deploy_4BEUNCciZoXyPfxSDZzDvWpTFtOZd86o","type":"Microsoft.Resources/deployments","properties":{"templateHash":"13772825678461016857","parameters":{"adminPassword":{"type":"SecureString"}},"mode":"Incremental","provisioningState":"Succeeded","timestamp":"2023-09-28T07:44:39.5370732Z","duration":"PT1M44.609501S","correlationId":"e90da160-3cce-4713-8974-6ebb726a12e9","providers":[{"namespace":"Microsoft.Network","resourceTypes":[{"resourceType":"virtualNetworks","locations":["eastus2"]},{"resourceType":"networkSecurityGroups","locations":["eastus2"]},{"resourceType":"publicIPAddresses","locations":["eastus2"]},{"resourceType":"networkInterfaces","locations":["eastus2"]}]},{"namespace":"Microsoft.Compute","resourceTypes":[{"resourceType":"virtualMachines","locations":["eastus2"]}]}],"dependencies":[{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/virtualNetworks/vm1VNET","resourceType":"Microsoft.Network/virtualNetworks","resourceName":"vm1VNET"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG","resourceType":"Microsoft.Network/networkSecurityGroups","resourceName":"vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP","resourceType":"Microsoft.Network/publicIPAddresses","resourceName":"vm1PublicIP"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"},{"dependsOn":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic","resourceType":"Microsoft.Network/networkInterfaces","resourceName":"vm1VMNic"}],"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1","resourceType":"Microsoft.Compute/virtualMachines","resourceName":"vm1"}],"outputs":{},"outputResources":[{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP"},{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/virtualNetworks/vm1VNET"}]}}' + headers: + cache-control: + - no-cache + content-length: + - '3289' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:44:59 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000; includeSubDomains + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1?$expand=instanceView&api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"vm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus2\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"hardwareProfile\": {\r\n \"vmSize\": + \"Standard_DS1_v2\"\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"vmId\": \"d07c7076-52a0-452a-89ba-1365f95bea28\",\r\n \"storageProfile\": + {\r\n \"imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n + \ \"offer\": \"WindowsServer\",\r\n \"sku\": \"2012-Datacenter\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"9200.24462.230825\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \"name\": + \"vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/disks/vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm1\",\r\n \"adminUsername\": \"clitester1\",\r\n + \ \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\n + \ \"enableAutomaticUpdates\": true,\r\n \"patchSettings\": {\r\n + \ \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"}]},\r\n + \ \"instanceView\": {\r\n \"computerName\": \"vm1\",\r\n \"osName\": + \"Windows Server 2012 Datacenter\",\r\n \"osVersion\": \"Microsoft Windows + NT 6.2.9200.0\",\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.1075\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n + \ \"message\": \"GuestAgent is running and processing the extensions.\",\r\n + \ \"time\": \"2023-09-28T07:44:55.034+00:00\"\r\n }\r\n + \ ]\r\n },\r\n \"disks\": [\r\n {\r\n \"name\": + \"vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\",\r\n \"statuses\": + [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2023-09-28T07:43:23.4257265+00:00\"\r\n + \ }\r\n ]\r\n }\r\n ],\r\n \"hyperVGeneration\": + \"V1\",\r\n \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2023-09-28T07:44:32.7221381+00:00\"\r\n + \ },\r\n {\r\n \"code\": \"PowerState/running\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n + \ }\r\n ]\r\n },\r\n \"timeCreated\": \"2023-09-28T07:43:17.7226418+00:00\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3384' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:01 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3996,Microsoft.Compute/LowCostGet30Min;31981 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"vm1VMNic\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\",\r\n + \ \"etag\": \"W/\\\"1374eda3-ae03-4f61-a9f1-061c53ade548\\\"\",\r\n \"tags\": + {},\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"resourceGuid\": \"4adceb0a-92cb-4052-ad13-c5cee68c1c00\",\r\n \"ipConfigurations\": + [\r\n {\r\n \"name\": \"ipconfigvm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic/ipConfigurations/ipconfigvm1\",\r\n + \ \"etag\": \"W/\\\"1374eda3-ae03-4f61-a9f1-061c53ade548\\\"\",\r\n + \ \"type\": \"Microsoft.Network/networkInterfaces/ipConfigurations\",\r\n + \ \"properties\": {\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"privateIPAddress\": \"10.0.0.4\",\r\n \"privateIPAllocationMethod\": + \"Dynamic\",\r\n \"publicIPAddress\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP\"\r\n + \ },\r\n \"subnet\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/virtualNetworks/vm1VNET/subnets/vm1Subnet\"\r\n + \ },\r\n \"primary\": true,\r\n \"privateIPAddressVersion\": + \"IPv4\"\r\n }\r\n }\r\n ],\r\n \"dnsSettings\": {\r\n \"dnsServers\": + [],\r\n \"appliedDnsServers\": [],\r\n \"internalDomainNameSuffix\": + \"gnrkyiw3elruro1fzuaijgy1za.cx.internal.cloudapp.net\"\r\n },\r\n \"macAddress\": + \"00-22-48-4D-5B-C8\",\r\n \"enableAcceleratedNetworking\": false,\r\n + \ \"vnetEncryptionSupported\": false,\r\n \"enableIPForwarding\": false,\r\n + \ \"networkSecurityGroup\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkSecurityGroups/vm1NSG\"\r\n + \ },\r\n \"primary\": true,\r\n \"virtualMachine\": {\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1\"\r\n + \ },\r\n \"hostedWorkloads\": [],\r\n \"tapConfigurations\": [],\r\n + \ \"nicType\": \"Standard\",\r\n \"allowPort25Out\": true,\r\n \"auxiliaryMode\": + \"None\"\r\n },\r\n \"type\": \"Microsoft.Network/networkInterfaces\",\r\n + \ \"location\": \"eastus2\",\r\n \"kind\": \"Regular\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2493' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:03 GMT + etag: + - W/"1374eda3-ae03-4f61-a9f1-061c53ade548" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - 345e73bc-c763-4cf4-9bf7-69696a9a4aa2 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm create + Connection: + - keep-alive + ParameterSetName: + - -g -n --image --admin-username --admin-password --nsg-rule + User-Agent: + - AZURECLI/2.53.0 (AAZ) azsdk-python-core/1.26.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP?api-version=2022-01-01 + response: + body: + string: "{\r\n \"name\": \"vm1PublicIP\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/publicIPAddresses/vm1PublicIP\",\r\n + \ \"etag\": \"W/\\\"72f7cdbe-36fd-41ce-954c-caaa285531d8\\\"\",\r\n \"location\": + \"eastus2\",\r\n \"tags\": {},\r\n \"properties\": {\r\n \"provisioningState\": + \"Succeeded\",\r\n \"resourceGuid\": \"e866f4ba-6a16-47a8-b9ac-e7da79e2c89a\",\r\n + \ \"ipAddress\": \"172.200.17.89\",\r\n \"publicIPAddressVersion\": \"IPv4\",\r\n + \ \"publicIPAllocationMethod\": \"Dynamic\",\r\n \"idleTimeoutInMinutes\": + 4,\r\n \"ipTags\": [],\r\n \"ipConfiguration\": {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic/ipConfigurations/ipconfigvm1\"\r\n + \ }\r\n },\r\n \"type\": \"Microsoft.Network/publicIPAddresses\",\r\n + \ \"sku\": {\r\n \"name\": \"Basic\",\r\n \"tier\": \"Regional\"\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '929' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:05 GMT + etag: + - W/"72f7cdbe-36fd-41ce-954c-caaa285531d8" + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-arm-service-request-id: + - ee8eadb0-5bdb-452b-b13a-236ed91b006c + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Content-Type: + - application/json + User-Agent: + - azsdk-python-keyvault-keys/4.8.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://vault000002.vault.azure.net/keys/KEK/create?api-version=7.4-preview.1 + response: + body: + string: '{"error":{"code":"Unauthorized","message":"AKV10000: Request is missing + a Bearer or PoP token."}}' + headers: + cache-control: + - no-cache + content-length: + - '97' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:06 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000;includeSubDomains + www-authenticate: + - Bearer authorization="https://login.microsoftonline.com/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a", + resource="https://vault.azure.net" + x-content-type-options: + - nosniff + x-ms-keyvault-network-info: + - conn_type=Ipv4;addr=167.220.255.20;act_addr_fam=InterNetwork; + x-ms-keyvault-region: + - eastus2 + x-ms-keyvault-service-version: + - 1.9.1003.1 + status: + code: 401 + message: Unauthorized +- request: + body: '{"kty": "RSA", "attributes": {"enabled": true}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '47' + Content-Type: + - application/json + User-Agent: + - azsdk-python-keyvault-keys/4.8.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: POST + uri: https://vault000002.vault.azure.net/keys/KEK/create?api-version=7.4-preview.1 + response: + body: + string: '{"key":{"kid":"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"p3U5d4_FWUclBZKau21ZuB7kN2WHsxIw3jB7UfN6I8Ai0CSbg9l_XUAfECif-YnmZuLULXSIqWoUF-nkTI7Znw77v9goVYKNiZKRBqGGkxpZxlEoebMRuuEjhJ3smeZ8W3c49ba02b_ica8hZkZSHPI3UYa_Ote_mjsGrKvI-4ktGG-2o3YbcPZA__kBIMdBIu2R4GYXTj_3Q4VqPpjH7b1qgfRc1OeEZd4AJPtX1MQBZu1qrtxyUQYMULua9HUAl4GuSb5UnZXSNWFVay1uQreVn_mJq3fifgY-Z1HwVKifEiyaCnxbjPLH-N9wC5U1ikdANYr8rLc0bwU4VNNBWQ","e":"AQAB"},"attributes":{"enabled":true,"created":1695887108,"updated":1695887108,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7,"exportable":false}}' + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:07 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000;includeSubDomains + x-content-type-options: + - nosniff + x-ms-keyvault-network-info: + - conn_type=Ipv4;addr=167.220.255.20;act_addr_fam=InterNetwork; + x-ms-keyvault-region: + - eastus2 + x-ms-keyvault-service-version: + - 1.9.1003.1 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1?api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"vm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus2\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"hardwareProfile\": {\r\n \"vmSize\": + \"Standard_DS1_v2\"\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"vmId\": \"d07c7076-52a0-452a-89ba-1365f95bea28\",\r\n \"storageProfile\": + {\r\n \"imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n + \ \"offer\": \"WindowsServer\",\r\n \"sku\": \"2012-Datacenter\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"9200.24462.230825\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \"name\": + \"vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/disks/vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm1\",\r\n \"adminUsername\": \"clitester1\",\r\n + \ \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\n + \ \"enableAutomaticUpdates\": true,\r\n \"patchSettings\": {\r\n + \ \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"}]},\r\n + \ \"timeCreated\": \"2023-09-28T07:43:17.7226418+00:00\"\r\n }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '2034' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:10 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3995,Microsoft.Compute/LowCostGet30Min;31980 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-keyvault/10.2.3 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002?api-version=2023-02-01 + response: + body: + string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002","name":"vault000002","type":"Microsoft.KeyVault/vaults","location":"eastus2","tags":{},"systemData":{"createdBy":"qinkaiwu@microsoft.com","createdByType":"User","createdAt":"2023-09-28T07:41:45.168Z","lastModifiedBy":"qinkaiwu@microsoft.com","lastModifiedByType":"User","lastModifiedAt":"2023-09-28T07:41:45.168Z"},"properties":{"sku":{"family":"A","name":"standard"},"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","accessPolicies":[{"tenantId":"54826b22-38d6-4fb2-bad9-b7b93a3e9c5a","objectId":"1afc88d9-8464-402f-af6f-7b57a5ace100","permissions":{"keys":["all"],"secrets":["all"],"certificates":["all"],"storage":["all"]}}],"enabledForDeployment":false,"enabledForDiskEncryption":true,"enableSoftDelete":true,"softDeleteRetentionInDays":7,"vaultUri":"https://vault000002.vault.azure.net/","provisioningState":"Succeeded","publicNetworkAccess":"Enabled"}}' + headers: + cache-control: + - no-cache + content-length: + - '1011' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:12 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-IIS/10.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-aspnet-version: + - 4.0.30319 + x-content-type-options: + - nosniff + x-ms-keyvault-service-version: + - 1.5.931.0 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + User-Agent: + - azsdk-python-keyvault-keys/4.8.0b2 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://vault000002.vault.azure.net/keys/KEK/?api-version=7.4-preview.1 + response: + body: + string: '{"key":{"kid":"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e","kty":"RSA","key_ops":["encrypt","decrypt","sign","verify","wrapKey","unwrapKey"],"n":"p3U5d4_FWUclBZKau21ZuB7kN2WHsxIw3jB7UfN6I8Ai0CSbg9l_XUAfECif-YnmZuLULXSIqWoUF-nkTI7Znw77v9goVYKNiZKRBqGGkxpZxlEoebMRuuEjhJ3smeZ8W3c49ba02b_ica8hZkZSHPI3UYa_Ote_mjsGrKvI-4ktGG-2o3YbcPZA__kBIMdBIu2R4GYXTj_3Q4VqPpjH7b1qgfRc1OeEZd4AJPtX1MQBZu1qrtxyUQYMULua9HUAl4GuSb5UnZXSNWFVay1uQreVn_mJq3fifgY-Z1HwVKifEiyaCnxbjPLH-N9wC5U1ikdANYr8rLc0bwU4VNNBWQ","e":"AQAB"},"attributes":{"enabled":true,"created":1695887108,"updated":1695887108,"recoveryLevel":"CustomizedRecoverable+Purgeable","recoverableDays":7,"exportable":false}}' + headers: + cache-control: + - no-cache + content-length: + - '698' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:13 GMT + expires: + - '-1' + pragma: + - no-cache + strict-transport-security: + - max-age=31536000;includeSubDomains + x-content-type-options: + - nosniff + x-ms-keyvault-network-info: + - conn_type=Ipv4;addr=167.220.255.20;act_addr_fam=InterNetwork; + x-ms-keyvault-region: + - eastus2 + x-ms-keyvault-service-version: + - 1.9.1003.1 + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "properties": {"publisher": "Microsoft.Azure.Security", + "type": "AzureDiskEncryption", "typeHandlerVersion": "2.2", "autoUpgradeMinorVersion": + true, "settings": {"KeyVaultURL": "https://vault000002.vault.azure.net", "VolumeType": + "ALL", "EncryptionOperation": "EnableEncryption", "KeyEncryptionKeyURL": "https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e", + "KeyEncryptionAlgorithm": "RSA-OAEP", "SequenceVersion": "5670ad07-99dd-4b0a-a428-4530484a8f70", + "KeyVaultResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002", + "KekVaultResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + Content-Length: + - '844' + Content-Type: + - application/json + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption?api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"AzureDiskEncryption\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n + \ \"provisioningState\": \"Creating\",\r\n \"publisher\": \"Microsoft.Azure.Security\",\r\n + \ \"type\": \"AzureDiskEncryption\",\r\n \"typeHandlerVersion\": \"2.2\",\r\n + \ \"settings\": {\"KeyVaultURL\":\"https://vault000002.vault.azure.net\",\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"EnableEncryption\",\"KeyEncryptionKeyURL\":\"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e\",\"KeyEncryptionAlgorithm\":\"RSA-OAEP\",\"SequenceVersion\":\"5670ad07-99dd-4b0a-a428-4530484a8f70\",\"KeyVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\",\"KekVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\"}\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/b52d1dad-0b68-4e9f-b445-0035557ff16e?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '1186' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/UpdateVM3Min;239,Microsoft.Compute/UpdateVM30Min;1199 + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/b52d1dad-0b68-4e9f-b445-0035557ff16e?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:45:19.081218+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"b52d1dad-0b68-4e9f-b445-0035557ff16e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '133' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:20 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14997,Microsoft.Compute/GetOperation30Min;29989 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/b52d1dad-0b68-4e9f-b445-0035557ff16e?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:45:19.081218+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"b52d1dad-0b68-4e9f-b445-0035557ff16e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '133' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:45:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14996,Microsoft.Compute/GetOperation30Min;29988 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/b52d1dad-0b68-4e9f-b445-0035557ff16e?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:45:19.081218+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"b52d1dad-0b68-4e9f-b445-0035557ff16e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '133' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:46:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14995,Microsoft.Compute/GetOperation30Min;29987 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/b52d1dad-0b68-4e9f-b445-0035557ff16e?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:45:19.081218+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"b52d1dad-0b68-4e9f-b445-0035557ff16e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '133' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:46:51 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14994,Microsoft.Compute/GetOperation30Min;29986 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/b52d1dad-0b68-4e9f-b445-0035557ff16e?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:45:19.081218+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"b52d1dad-0b68-4e9f-b445-0035557ff16e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '133' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:21 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29984 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/b52d1dad-0b68-4e9f-b445-0035557ff16e?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:45:19.081218+00:00\",\r\n \"endTime\": + \"2023-09-28T07:47:40.5022494+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"b52d1dad-0b68-4e9f-b445-0035557ff16e\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '183' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:52 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14992,Microsoft.Compute/GetOperation30Min;29982 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption?api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"AzureDiskEncryption\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"publisher\": \"Microsoft.Azure.Security\",\r\n + \ \"type\": \"AzureDiskEncryption\",\r\n \"typeHandlerVersion\": \"2.2\",\r\n + \ \"settings\": {\"KeyVaultURL\":\"https://vault000002.vault.azure.net\",\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"EnableEncryption\",\"KeyEncryptionKeyURL\":\"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e\",\"KeyEncryptionAlgorithm\":\"RSA-OAEP\",\"SequenceVersion\":\"5670ad07-99dd-4b0a-a428-4530484a8f70\",\"KeyVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\",\"KekVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\"}\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1187' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:53 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3994,Microsoft.Compute/LowCostGet30Min;31977 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption enable + Connection: + - keep-alive + ParameterSetName: + - -g -n --disk-encryption-keyvault --key-encryption-key + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption?$expand=instanceView&api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"AzureDiskEncryption\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"name\": + \"AzureDiskEncryption\",\r\n \"type\": \"Microsoft.Azure.Security.AzureDiskEncryption\",\r\n + \ \"typeHandlerVersion\": \"2.4.0.2\",\r\n \"statuses\": [\r\n {\r\n + \ \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": + \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n + \ \"message\": \"[2.4.0.2] \"\r\n }\r\n ]\r\n },\r\n + \ \"publisher\": \"Microsoft.Azure.Security\",\r\n \"type\": \"AzureDiskEncryption\",\r\n + \ \"typeHandlerVersion\": \"2.2\",\r\n \"settings\": {\"KeyVaultURL\":\"https://vault000002.vault.azure.net\",\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"EnableEncryption\",\"KeyEncryptionKeyURL\":\"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e\",\"KeyEncryptionAlgorithm\":\"RSA-OAEP\",\"SequenceVersion\":\"5670ad07-99dd-4b0a-a428-4530484a8f70\",\"KeyVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\",\"KekVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\"}\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1578' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:54 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3993,Microsoft.Compute/LowCostGet30Min;31976 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption show + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1?$expand=instanceView&api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"vm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus2\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"hardwareProfile\": {\r\n \"vmSize\": + \"Standard_DS1_v2\"\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"vmId\": \"d07c7076-52a0-452a-89ba-1365f95bea28\",\r\n \"storageProfile\": + {\r\n \"imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n + \ \"offer\": \"WindowsServer\",\r\n \"sku\": \"2012-Datacenter\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"9200.24462.230825\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \"name\": + \"vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/disks/vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm1\",\r\n \"adminUsername\": \"clitester1\",\r\n + \ \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\n + \ \"enableAutomaticUpdates\": true,\r\n \"patchSettings\": {\r\n + \ \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"}]},\r\n + \ \"instanceView\": {\r\n \"computerName\": \"vm1\",\r\n \"osName\": + \"Windows Server 2012 Datacenter\",\r\n \"osVersion\": \"Microsoft Windows + NT 6.2.9200.0\",\r\n \"vmAgent\": {\r\n \"vmAgentVersion\": \"2.7.41491.1075\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\",\r\n + \ \"message\": \"GuestAgent is running and processing the extensions.\",\r\n + \ \"time\": \"2023-09-28T07:47:52.895+00:00\"\r\n }\r\n + \ ],\r\n \"extensionHandlers\": [\r\n {\r\n \"type\": + \"Microsoft.Azure.Security.AzureDiskEncryption\",\r\n \"typeHandlerVersion\": + \"2.4.0.2\",\r\n \"status\": {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Ready\"\r\n + \ }\r\n }\r\n ]\r\n },\r\n \"disks\": + [\r\n {\r\n \"name\": \"vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\",\r\n + \ \"encryptionSettings\": [\r\n {\r\n \"enabled\": + true,\r\n \"diskEncryptionKey\": {\r\n \"sourceVault\": + {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\"\r\n + \ },\r\n \"secretUrl\": \"https://vault000002.vault.azure.net/secrets/C072506A-F6B3-472D-8B3B-A305ADC0BA24/60d12d2c1be3442abd678d61b08ab472\"\r\n + \ },\r\n \"keyEncryptionKey\": {\r\n \"sourceVault\": + {\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\"\r\n + \ },\r\n \"keyUrl\": \"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e\"\r\n + \ }\r\n }\r\n ],\r\n \"statuses\": + [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2023-09-28T07:47:40.3460022+00:00\"\r\n + \ },\r\n {\r\n \"code\": \"EncryptionState/encrypted\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Encryption + is enabled on disk\"\r\n }\r\n ]\r\n }\r\n ],\r\n + \ \"extensions\": [\r\n {\r\n \"name\": \"AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Azure.Security.AzureDiskEncryption\",\r\n + \ \"typeHandlerVersion\": \"2.4.0.2\",\r\n \"statuses\": + [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"message\": \"[2.4.0.2] \"\r\n }\r\n + \ ]\r\n }\r\n ],\r\n \"hyperVGeneration\": \"V1\",\r\n + \ \"statuses\": [\r\n {\r\n \"code\": \"ProvisioningState/succeeded\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"Provisioning + succeeded\",\r\n \"time\": \"2023-09-28T07:47:40.3616165+00:00\"\r\n + \ },\r\n {\r\n \"code\": \"PowerState/running\",\r\n + \ \"level\": \"Info\",\r\n \"displayStatus\": \"VM running\"\r\n + \ }\r\n ]\r\n },\r\n \"timeCreated\": \"2023-09-28T07:43:17.7226418+00:00\"\r\n + \ },\r\n \"resources\": [\r\n {\r\n \"name\": \"AzureDiskEncryption\",\r\n + \ \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": + true,\r\n \"provisioningState\": \"Succeeded\",\r\n \"publisher\": + \"Microsoft.Azure.Security\",\r\n \"type\": \"AzureDiskEncryption\",\r\n + \ \"typeHandlerVersion\": \"2.2\",\r\n \"settings\": {\"KeyVaultURL\":\"https://vault000002.vault.azure.net\",\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"EnableEncryption\",\"KeyEncryptionKeyURL\":\"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e\",\"KeyEncryptionAlgorithm\":\"RSA-OAEP\",\"SequenceVersion\":\"5670ad07-99dd-4b0a-a428-4530484a8f70\",\"KeyVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\",\"KekVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\"}\r\n + \ }\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '6566' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:55 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31975 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption disable + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1?api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"vm1\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines\",\r\n \"location\": \"eastus2\",\r\n + \ \"tags\": {},\r\n \"properties\": {\r\n \"hardwareProfile\": {\r\n \"vmSize\": + \"Standard_DS1_v2\"\r\n },\r\n \"provisioningState\": \"Succeeded\",\r\n + \ \"vmId\": \"d07c7076-52a0-452a-89ba-1365f95bea28\",\r\n \"storageProfile\": + {\r\n \"imageReference\": {\r\n \"publisher\": \"MicrosoftWindowsServer\",\r\n + \ \"offer\": \"WindowsServer\",\r\n \"sku\": \"2012-Datacenter\",\r\n + \ \"version\": \"latest\",\r\n \"exactVersion\": \"9200.24462.230825\"\r\n + \ },\r\n \"osDisk\": {\r\n \"osType\": \"Windows\",\r\n \"name\": + \"vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\",\r\n \"createOption\": + \"FromImage\",\r\n \"caching\": \"ReadWrite\",\r\n \"managedDisk\": + {\r\n \"storageAccountType\": \"Premium_LRS\",\r\n \"id\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/disks/vm1_OsDisk_1_fc0cf4f5323f4e838450b19b640dfde6\"\r\n + \ },\r\n \"deleteOption\": \"Detach\",\r\n \"diskSizeGB\": + 127\r\n },\r\n \"dataDisks\": []\r\n },\r\n \"osProfile\": + {\r\n \"computerName\": \"vm1\",\r\n \"adminUsername\": \"clitester1\",\r\n + \ \"windowsConfiguration\": {\r\n \"provisionVMAgent\": true,\r\n + \ \"enableAutomaticUpdates\": true,\r\n \"patchSettings\": {\r\n + \ \"patchMode\": \"AutomaticByOS\",\r\n \"assessmentMode\": + \"ImageDefault\"\r\n },\r\n \"enableVMAgentPlatformUpdates\": + false\r\n },\r\n \"secrets\": [],\r\n \"allowExtensionOperations\": + true,\r\n \"requireGuestProvisionSignal\": true\r\n },\r\n \"networkProfile\": + {\"networkInterfaces\":[{\"id\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Network/networkInterfaces/vm1VMNic\"}]},\r\n + \ \"timeCreated\": \"2023-09-28T07:43:17.7226418+00:00\"\r\n },\r\n \"resources\": + [\r\n {\r\n \"name\": \"AzureDiskEncryption\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": + true,\r\n \"provisioningState\": \"Succeeded\",\r\n \"publisher\": + \"Microsoft.Azure.Security\",\r\n \"type\": \"AzureDiskEncryption\",\r\n + \ \"typeHandlerVersion\": \"2.2\",\r\n \"settings\": {\"KeyVaultURL\":\"https://vault000002.vault.azure.net\",\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"EnableEncryption\",\"KeyEncryptionKeyURL\":\"https://vault000002.vault.azure.net/keys/KEK/f240968c0fc548e1b4dc51c630f9499e\",\"KeyEncryptionAlgorithm\":\"RSA-OAEP\",\"SequenceVersion\":\"5670ad07-99dd-4b0a-a428-4530484a8f70\",\"KeyVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\",\"KekVaultResourceId\":\"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.KeyVault/vaults/vault000002\"}\r\n + \ }\r\n }\r\n ]\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '3303' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:57 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31974 + status: + code: 200 + message: OK +- request: + body: '{"location": "eastus2", "properties": {"publisher": "Microsoft.Azure.Security", + "typeHandlerVersion": "2.2", "autoUpgradeMinorVersion": true, "settings": {"VolumeType": + "ALL", "EncryptionOperation": "DisableEncryption", "SequenceVersion": "6f034dbe-aa37-462f-adf8-adba0334731a"}}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption disable + Connection: + - keep-alive + Content-Length: + - '280' + Content-Type: + - application/json + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption?api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"AzureDiskEncryption\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n + \ \"provisioningState\": \"Updating\",\r\n \"publisher\": \"Microsoft.Azure.Security\",\r\n + \ \"type\": \"AzureDiskEncryption\",\r\n \"typeHandlerVersion\": \"2.2\",\r\n + \ \"settings\": {\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"DisableEncryption\",\"SequenceVersion\":\"6f034dbe-aa37-462f-adf8-adba0334731a\"}\r\n + \ }\r\n}" + headers: + azure-asyncnotification: + - Enabled + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/39e2284e-f2c6-459d-9714-8695d2121026?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + cache-control: + - no-cache + content-length: + - '663' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:58 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/UpdateVM3Min;238,Microsoft.Compute/UpdateVM30Min;1198 + x-ms-ratelimit-remaining-subscription-writes: + - '1198' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption disable + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/39e2284e-f2c6-459d-9714-8695d2121026?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:47:58.8771346+00:00\",\r\n \"status\": + \"InProgress\",\r\n \"name\": \"39e2284e-f2c6-459d-9714-8695d2121026\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '134' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:47:59 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14991,Microsoft.Compute/GetOperation30Min;29981 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption disable + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Compute/locations/eastus2/operations/39e2284e-f2c6-459d-9714-8695d2121026?p=4da1aac7-dfbb-41ae-bded-ca0db7baa978&api-version=2022-11-01 + response: + body: + string: "{\r\n \"startTime\": \"2023-09-28T07:47:58.8771346+00:00\",\r\n \"endTime\": + \"2023-09-28T07:48:22.7051321+00:00\",\r\n \"status\": \"Succeeded\",\r\n + \ \"name\": \"39e2284e-f2c6-459d-9714-8695d2121026\"\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '184' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:48:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/GetOperation3Min;14990,Microsoft.Compute/GetOperation30Min;29979 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption disable + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption?api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"AzureDiskEncryption\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"publisher\": \"Microsoft.Azure.Security\",\r\n + \ \"type\": \"AzureDiskEncryption\",\r\n \"typeHandlerVersion\": \"2.2\",\r\n + \ \"settings\": {\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"DisableEncryption\",\"SequenceVersion\":\"6f034dbe-aa37-462f-adf8-adba0334731a\"}\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '664' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:48:29 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3992,Microsoft.Compute/LowCostGet30Min;31972 + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - vm encryption disable + Connection: + - keep-alive + ParameterSetName: + - -g -n + User-Agent: + - AZURECLI/2.53.0 azsdk-python-azure-mgmt-compute/30.0.0 Python/3.10.11 (Windows-10-10.0.22621-SP0) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption?$expand=instanceView&api-version=2022-11-01 + response: + body: + string: "{\r\n \"name\": \"AzureDiskEncryption\",\r\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_vm_encryption000001/providers/Microsoft.Compute/virtualMachines/vm1/extensions/AzureDiskEncryption\",\r\n + \ \"type\": \"Microsoft.Compute/virtualMachines/extensions\",\r\n \"location\": + \"eastus2\",\r\n \"properties\": {\r\n \"autoUpgradeMinorVersion\": true,\r\n + \ \"provisioningState\": \"Succeeded\",\r\n \"instanceView\": {\r\n \"name\": + \"AzureDiskEncryption\",\r\n \"type\": \"Microsoft.Azure.Security.AzureDiskEncryption\",\r\n + \ \"typeHandlerVersion\": \"2.4.0.2\",\r\n \"statuses\": [\r\n {\r\n + \ \"code\": \"ProvisioningState/succeeded\",\r\n \"level\": + \"Info\",\r\n \"displayStatus\": \"Provisioning succeeded\",\r\n + \ \"message\": \"[2.4.0.2] Disable Encryption completed successfully\"\r\n + \ }\r\n ]\r\n },\r\n \"publisher\": \"Microsoft.Azure.Security\",\r\n + \ \"type\": \"AzureDiskEncryption\",\r\n \"typeHandlerVersion\": \"2.2\",\r\n + \ \"settings\": {\"VolumeType\":\"ALL\",\"EncryptionOperation\":\"DisableEncryption\",\"SequenceVersion\":\"6f034dbe-aa37-462f-adf8-adba0334731a\"}\r\n + \ }\r\n}" + headers: + cache-control: + - no-cache + content-length: + - '1096' + content-type: + - application/json; charset=utf-8 + date: + - Thu, 28 Sep 2023 07:48:30 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - Microsoft-HTTPAPI/2.0 + - Microsoft-HTTPAPI/2.0 + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-resource: + - Microsoft.Compute/LowCostGet3Min;3991,Microsoft.Compute/LowCostGet30Min;31971 + status: + code: 200 + message: OK +version: 1 diff --git a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py index 5ec5b3fa094..9f68cb8902c 100644 --- a/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py +++ b/src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_vm_commands.py @@ -5360,6 +5360,19 @@ def test_vm_disk_encryption_e2e(self, resource_group, resource_group_location, k self.cmd('vm encryption show -g {rg} -n {vm}', checks=[self.check('disks[0].statuses[0].code', 'EncryptionState/encrypted')]) self.cmd('vm encryption disable -g {rg} -n {vm}') + @ResourceGroupPreparer(name_prefix='cli_test_vm_encryption', location='eastus2') + @KeyVaultPreparer(name_prefix='vault', name_len=10, location='eastus2', key='vault', additional_params='--enabled-for-disk-encryption') + def test_vm_disk_encryption_with_key(self, resource_group, resource_group_location, key_vault): + self.kwargs.update({ + 'vm': 'vm1', + 'key': 'KEK' + }) + self.cmd('vm create -g {rg} -n {vm} --image win2012datacenter --admin-username clitester1 --admin-password Test123456789! --nsg-rule NONE') + self.cmd('keyvault key create --vault-name {vault} --name {key} --protection software') + self.cmd('vm encryption enable -g {rg} -n {vm} --disk-encryption-keyvault {vault} --key-encryption-key {key}') + self.cmd('vm encryption show -g {rg} -n {vm}', checks=[self.check('disks[0].statuses[0].code', 'EncryptionState/encrypted')]) + self.cmd('vm encryption disable -g {rg} -n {vm}') + @ResourceGroupPreparer(name_prefix='cli_test_vm_encryption_at_host_', location='westus') def test_vm_encryption_at_host(self, resource_group): self.kwargs.update({