diff --git a/src/Compute/Compute.Test/ScenarioTests/sshKeyTests.cs b/src/Compute/Compute.Test/ScenarioTests/sshKeyTests.cs new file mode 100644 index 000000000000..1f0d0e9b503b --- /dev/null +++ b/src/Compute/Compute.Test/ScenarioTests/sshKeyTests.cs @@ -0,0 +1,34 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Microsoft.Azure.Commands.Compute.Test.ScenarioTests +{ + public class sshKeyTests : ComputeTestRunner + { + public sshKeyTests(Xunit.Abstractions.ITestOutputHelper output) + : base(output) + { + } + + [Fact] + [Trait(Category.AcceptanceType, Category.CheckIn)] + public void TestSshKey() + { + TestRunner.RunTestScript("Test-SshKey"); + } + } +} diff --git a/src/Compute/Compute.Test/ScenarioTests/sshKeyTests.ps1 b/src/Compute/Compute.Test/ScenarioTests/sshKeyTests.ps1 new file mode 100644 index 000000000000..d6c38a074862 --- /dev/null +++ b/src/Compute/Compute.Test/ScenarioTests/sshKeyTests.ps1 @@ -0,0 +1,57 @@ +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +<# +.SYNOPSIS +Test SshKeyResource creation +#> +function Test-SshKey +{ + $loc = 'westus' + $rgname = Get-ComputeTestResourceName + + try + { + New-AzResourceGroup -Name $rgname -Location $loc -Force; + + #create sshkey1 + $sshkey1 = New-AzSshKey -ResourceGroupName $rgname -Name "sshkey1" + + #create sshkey2 + $sshkey2 = New-AzSshKey -ResourceGroupName $rgname -Name "sshkey2" + + #Get-AzSshKey should return 2 + $sshKeysResult = Get-AzSshKey -ResourceGroupName $rgname + Assert-AreEqual $sshKeysResult.count 2 + + #update key1.publickey with publickey2 + Update-AzSshKey -ResourceGroupName $rgname -Name "sshkey1" -publickey $sshKey2.publicKey + + #check key1 + $sshkey1 = Get-AzSshKey -ResourceGroupName $rgname -Name "sshkey1" + Assert-AreEqual $sshkey1.publickey $sshkey2.publickey + + #remove sshkey2 + Remove-AzSshKey -ResourceGroupName $rgname -Name "sshkey2" + + #getshould return1 + $sshKeysResult = Get-AzSshKey -ResourceGroupName $rgname + Assert-AreEqual $sshKeysResult.count 1 + } + finally + { + Clean-ResourceGroup $rgname + } + +} diff --git a/src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.sshKeyTests/TestSshKey.json b/src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.sshKeyTests/TestSshKey.json new file mode 100644 index 000000000000..16fe98a6cd1b --- /dev/null +++ b/src/Compute/Compute.Test/SessionRecords/Microsoft.Azure.Commands.Compute.Test.ScenarioTests.sshKeyTests/TestSshKey.json @@ -0,0 +1,1323 @@ +{ + "Entries": [ + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourcegroups/crptestps4815?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlZ3JvdXBzL2NycHRlc3RwczQ4MTU/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "19c752e0-3852-419e-a943-13c9499b64ad" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-request-id": [ + "27ea90e7-1d4c-47fc-8134-176dbddf96e7" + ], + "x-ms-correlation-request-id": [ + "27ea90e7-1d4c-47fc-8134-176dbddf96e7" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195220Z:27ea90e7-1d4c-47fc-8134-176dbddf96e7" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:20 GMT" + ], + "Content-Length": [ + "179" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815\",\r\n \"name\": \"crptestps4815\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourcegroups/crptestps4815?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlZ3JvdXBzL2NycHRlc3RwczQ4MTU/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "437c1c65-4f7d-4c33-bdb0-430354c48af0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "c6e1df5a-c7c3-4f10-8635-d771b487741f" + ], + "x-ms-correlation-request-id": [ + "c6e1df5a-c7c3-4f10-8635-d771b487741f" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195221Z:c6e1df5a-c7c3-4f10-8635-d771b487741f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:20 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "179" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815\",\r\n \"name\": \"crptestps4815\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourcegroups/crptestps4815?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlZ3JvdXBzL2NycHRlc3RwczQ4MTU/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d77ebe8f-54b5-4fc7-ace5-f99f1a70a3bb" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "0a04352e-9052-408f-b7ca-4e81aae44c8f" + ], + "x-ms-correlation-request-id": [ + "0a04352e-9052-408f-b7ca-4e81aae44c8f" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195224Z:0a04352e-9052-408f-b7ca-4e81aae44c8f" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:24 GMT" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "179" + ] + }, + "ResponseBody": "{\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815\",\r\n \"name\": \"crptestps4815\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXMvc3Noa2V5MT9hcGktdmVyc2lvbj0yMDIwLTEyLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "437c1c65-4f7d-4c33-bdb0-430354c48af0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/PutDeleteSshPublicKeys3Min;119,Microsoft.Compute/PutDeleteSshPublicKeys30Min;599" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "19bbf13c-ee18-47b1-8791-08ad12a4c184" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "ec703f84-4e3b-40bb-982b-7e1daf44efa9" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195223Z:ec703f84-4e3b-40bb-982b-7e1daf44efa9" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:23 GMT" + ], + "Content-Length": [ + "214" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"sshkey1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1\",\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1/generateKeyPair?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXMvc3Noa2V5MS9nZW5lcmF0ZUtleVBhaXI/YXBpLXZlcnNpb249MjAyMC0xMi0wMQ==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "437c1c65-4f7d-4c33-bdb0-430354c48af0" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/SshKeyGen3Min;4,Microsoft.Compute/SshKeyGen30Min;14" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "809e873b-a5e2-4465-a3cd-6876c9e8cb59" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "fadeb329-f83b-464f-a792-da716b287d37" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195224Z:fadeb329-f83b-464f-a792-da716b287d37" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:23 GMT" + ], + "Content-Length": [ + "3366" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"privateKey\": \"-----BEGIN RSA PRIVATE KEY-----\\r\\n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\\r\\n-----END RSA PRIVATE KEY-----\\r\\n\",\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCcDyhAcMBMeXPjXayMox+2btLz\\r\\nwxh6UP1ByFB7SZWKLWEGLHF90HJuBg70+hy/eMiTbIGLi+hVL41Rm1vKwHhq5tbN\\r\\npFAralHLr8sFe9ICBUm24RO+CYQOjDJXL6kEYcVXMERtDq/LUafjvIITU9J0NHk2\\r\\nPrzvNapYzlaMBj76u0k2YcZZI2h2ktGZpE5DYD9xqYkq9a58+jsKGYtN7Q6Zk9hY\\r\\nkPUZqXMYbiBhwB+zrx7Vi7XvEIiFbQDrxmYBPPZX8zR5bTznc1/+AIX2U5+jih35\\r\\n3HBZRXshHkgjHBbsbz+6ue+fZZnoOAKaOUckHyA4DKEDYFyGvhmFqgM8CfbUz7IA\\r\\nI2d6e/7DD67ymxnvNQD5OpIAVcHzDp0TIN9NWpCOpTSFUdrgecdcV3h/Jl0rs5V5\\r\\nJR3/HJTPUntIedqKC1n6qzPNeSE274Yp8TCioKxqXOhR0l90kOHgwZkrxju/UXD4\\r\\nuteKF8aeGxpTnC0i2/ZUUctCxEiMuHpW0XmJqpU= generated-by-azure\\r\\n\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys/sshkey2?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXMvc3Noa2V5Mj9hcGktdmVyc2lvbj0yMDIwLTEyLTAx", + "RequestMethod": "PUT", + "RequestBody": "{\r\n \"location\": \"westus\"\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d77ebe8f-54b5-4fc7-ace5-f99f1a70a3bb" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "28" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/PutDeleteSshPublicKeys3Min;118,Microsoft.Compute/PutDeleteSshPublicKeys30Min;598" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "c7621ae1-a979-4446-8a93-6de2df57e9a5" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "b18b0440-6166-4f73-b9d9-173d20a0fb92" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195227Z:b18b0440-6166-4f73-b9d9-173d20a0fb92" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:26 GMT" + ], + "Content-Length": [ + "214" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"sshkey2\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey2\",\r\n \"location\": \"westus\",\r\n \"properties\": {}\r\n}", + "StatusCode": 201 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys/sshkey2/generateKeyPair?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXMvc3Noa2V5Mi9nZW5lcmF0ZUtleVBhaXI/YXBpLXZlcnNpb249MjAyMC0xMi0wMQ==", + "RequestMethod": "POST", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d77ebe8f-54b5-4fc7-ace5-f99f1a70a3bb" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/SshKeyGen3Min;3,Microsoft.Compute/SshKeyGen30Min;13" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "126d22cb-ccf0-4189-9047-ea96acc45466" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "b67486a1-d32c-4c76-a896-dd25ed4019da" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195227Z:b67486a1-d32c-4c76-a896-dd25ed4019da" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:26 GMT" + ], + "Content-Length": [ + "3366" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"privateKey\": \"-----BEGIN RSA PRIVATE KEY-----\\r\\n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\\r\\n-----END RSA PRIVATE KEY-----\\r\\n\",\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqBcuHMD5lQOLwLOHod52eiEy1\\r\\n5E12HkWz53PN9WI19T50uo1lSSVVBjkW2WZBlbPTSh/k/0qL3027z6x0mLhnyaOv\\r\\nDNqX/4RuexOLZaJYqTisszuRlcZW58WEOrvTlJ1+6ycMPWTL8iFH6trEGu1Ll8Nz\\r\\n0J3nT2DH3Xr01Dy12mQKLuXrhns5ybRHy0IzGtwkcL7wpFI1cVqQiKibPZbSd9Vd\\r\\nT+7Jtz3r/pSYQa/HRO39A8c60fB3wP7fLz0kQl+6TKtDdWtRgN0cQpRYrMa4kJjT\\r\\nRYUUyDz2f/8+i9CWoHPbA/9C9PXzPVdnLWQt0k9rzqaU8BDqP0IngjeYCkwxYRy4\\r\\nrTTxnBNfOTns5uwW0ppPVXNKtkylkqSpbKXCeTZgepT3u1z37qCilgcTYDQTCy30\\r\\nwy06cnmtS7DnV/x+FOPA6WsIVVhaJ5Vj6LesvuOC93hRoMxWkbNYuLnEAPiqbxCy\\r\\nFe7fzRIylUI5d6P2x2wsHdrW8ReWCGqimi//tAk= generated-by-azure\\r\\n\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey2\"\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXM/YXBpLXZlcnNpb249MjAyMC0xMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "d2504693-6ed6-43f7-8c69-1bc29ae1bdb8" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/LowCostGet3Min;3999,Microsoft.Compute/LowCostGet30Min;31999" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "1f42b40a-aa47-4689-9579-ab6e89dc42fc" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11989" + ], + "x-ms-correlation-request-id": [ + "02b2ab90-ef44-4eb6-8b2f-0a076c49f341" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195228Z:02b2ab90-ef44-4eb6-8b2f-0a076c49f341" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:27 GMT" + ], + "Content-Length": [ + "1784" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"sshkey1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCcDyhAcMBMeXPjXayMox+2btLz\\r\\nwxh6UP1ByFB7SZWKLWEGLHF90HJuBg70+hy/eMiTbIGLi+hVL41Rm1vKwHhq5tbN\\r\\npFAralHLr8sFe9ICBUm24RO+CYQOjDJXL6kEYcVXMERtDq/LUafjvIITU9J0NHk2\\r\\nPrzvNapYzlaMBj76u0k2YcZZI2h2ktGZpE5DYD9xqYkq9a58+jsKGYtN7Q6Zk9hY\\r\\nkPUZqXMYbiBhwB+zrx7Vi7XvEIiFbQDrxmYBPPZX8zR5bTznc1/+AIX2U5+jih35\\r\\n3HBZRXshHkgjHBbsbz+6ue+fZZnoOAKaOUckHyA4DKEDYFyGvhmFqgM8CfbUz7IA\\r\\nI2d6e/7DD67ymxnvNQD5OpIAVcHzDp0TIN9NWpCOpTSFUdrgecdcV3h/Jl0rs5V5\\r\\nJR3/HJTPUntIedqKC1n6qzPNeSE274Yp8TCioKxqXOhR0l90kOHgwZkrxju/UXD4\\r\\nuteKF8aeGxpTnC0i2/ZUUctCxEiMuHpW0XmJqpU= generated-by-azure\\r\\n\"\r\n }\r\n },\r\n {\r\n \"name\": \"sshkey2\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey2\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqBcuHMD5lQOLwLOHod52eiEy1\\r\\n5E12HkWz53PN9WI19T50uo1lSSVVBjkW2WZBlbPTSh/k/0qL3027z6x0mLhnyaOv\\r\\nDNqX/4RuexOLZaJYqTisszuRlcZW58WEOrvTlJ1+6ycMPWTL8iFH6trEGu1Ll8Nz\\r\\n0J3nT2DH3Xr01Dy12mQKLuXrhns5ybRHy0IzGtwkcL7wpFI1cVqQiKibPZbSd9Vd\\r\\nT+7Jtz3r/pSYQa/HRO39A8c60fB3wP7fLz0kQl+6TKtDdWtRgN0cQpRYrMa4kJjT\\r\\nRYUUyDz2f/8+i9CWoHPbA/9C9PXzPVdnLWQt0k9rzqaU8BDqP0IngjeYCkwxYRy4\\r\\nrTTxnBNfOTns5uwW0ppPVXNKtkylkqSpbKXCeTZgepT3u1z37qCilgcTYDQTCy30\\r\\nwy06cnmtS7DnV/x+FOPA6WsIVVhaJ5Vj6LesvuOC93hRoMxWkbNYuLnEAPiqbxCy\\r\\nFe7fzRIylUI5d6P2x2wsHdrW8ReWCGqimi//tAk= generated-by-azure\\r\\n\"\r\n }\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXM/YXBpLXZlcnNpb249MjAyMC0xMi0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "43f4a40f-d1a2-4055-aca6-df6a17a8ad24" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/LowCostGet3Min;3997,Microsoft.Compute/LowCostGet30Min;31997" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "de83dbe6-0031-4890-be69-b509da4a6fe1" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "a7f8f5d8-1b09-4913-b41f-2dc8eec296d2" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195231Z:a7f8f5d8-1b09-4913-b41f-2dc8eec296d2" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:30 GMT" + ], + "Content-Length": [ + "903" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"value\": [\r\n {\r\n \"name\": \"sshkey1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqBcuHMD5lQOLwLOHod52eiEy1\\r\\n5E12HkWz53PN9WI19T50uo1lSSVVBjkW2WZBlbPTSh/k/0qL3027z6x0mLhnyaOv\\r\\nDNqX/4RuexOLZaJYqTisszuRlcZW58WEOrvTlJ1+6ycMPWTL8iFH6trEGu1Ll8Nz\\r\\n0J3nT2DH3Xr01Dy12mQKLuXrhns5ybRHy0IzGtwkcL7wpFI1cVqQiKibPZbSd9Vd\\r\\nT+7Jtz3r/pSYQa/HRO39A8c60fB3wP7fLz0kQl+6TKtDdWtRgN0cQpRYrMa4kJjT\\r\\nRYUUyDz2f/8+i9CWoHPbA/9C9PXzPVdnLWQt0k9rzqaU8BDqP0IngjeYCkwxYRy4\\r\\nrTTxnBNfOTns5uwW0ppPVXNKtkylkqSpbKXCeTZgepT3u1z37qCilgcTYDQTCy30\\r\\nwy06cnmtS7DnV/x+FOPA6WsIVVhaJ5Vj6LesvuOC93hRoMxWkbNYuLnEAPiqbxCy\\r\\nFe7fzRIylUI5d6P2x2wsHdrW8ReWCGqimi//tAk= generated-by-azure\\r\\n\"\r\n }\r\n }\r\n ]\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXMvc3Noa2V5MT9hcGktdmVyc2lvbj0yMDIwLTEyLTAx", + "RequestMethod": "PATCH", + "RequestBody": "{\r\n \"properties\": {\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqBcuHMD5lQOLwLOHod52eiEy1\\r\\n5E12HkWz53PN9WI19T50uo1lSSVVBjkW2WZBlbPTSh/k/0qL3027z6x0mLhnyaOv\\r\\nDNqX/4RuexOLZaJYqTisszuRlcZW58WEOrvTlJ1+6ycMPWTL8iFH6trEGu1Ll8Nz\\r\\n0J3nT2DH3Xr01Dy12mQKLuXrhns5ybRHy0IzGtwkcL7wpFI1cVqQiKibPZbSd9Vd\\r\\nT+7Jtz3r/pSYQa/HRO39A8c60fB3wP7fLz0kQl+6TKtDdWtRgN0cQpRYrMa4kJjT\\r\\nRYUUyDz2f/8+i9CWoHPbA/9C9PXzPVdnLWQt0k9rzqaU8BDqP0IngjeYCkwxYRy4\\r\\nrTTxnBNfOTns5uwW0ppPVXNKtkylkqSpbKXCeTZgepT3u1z37qCilgcTYDQTCy30\\r\\nwy06cnmtS7DnV/x+FOPA6WsIVVhaJ5Vj6LesvuOC93hRoMxWkbNYuLnEAPiqbxCy\\r\\nFe7fzRIylUI5d6P2x2wsHdrW8ReWCGqimi//tAk= generated-by-azure\\r\\n\"\r\n }\r\n}", + "RequestHeaders": { + "x-ms-client-request-id": [ + "b035ab61-fb20-4108-ace9-41059665d734" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Content-Length": [ + "656" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/PutDeleteSshPublicKeys3Min;117,Microsoft.Compute/PutDeleteSshPublicKeys30Min;597" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "c8a34807-94de-4b67-a6af-5dad35e0333a" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-writes": [ + "1199" + ], + "x-ms-correlation-request-id": [ + "4ad920ce-9bbf-4634-b520-dc0ff92f540e" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195229Z:4ad920ce-9bbf-4634-b520-dc0ff92f540e" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:29 GMT" + ], + "Content-Length": [ + "846" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"sshkey1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqBcuHMD5lQOLwLOHod52eiEy1\\r\\n5E12HkWz53PN9WI19T50uo1lSSVVBjkW2WZBlbPTSh/k/0qL3027z6x0mLhnyaOv\\r\\nDNqX/4RuexOLZaJYqTisszuRlcZW58WEOrvTlJ1+6ycMPWTL8iFH6trEGu1Ll8Nz\\r\\n0J3nT2DH3Xr01Dy12mQKLuXrhns5ybRHy0IzGtwkcL7wpFI1cVqQiKibPZbSd9Vd\\r\\nT+7Jtz3r/pSYQa/HRO39A8c60fB3wP7fLz0kQl+6TKtDdWtRgN0cQpRYrMa4kJjT\\r\\nRYUUyDz2f/8+i9CWoHPbA/9C9PXzPVdnLWQt0k9rzqaU8BDqP0IngjeYCkwxYRy4\\r\\nrTTxnBNfOTns5uwW0ppPVXNKtkylkqSpbKXCeTZgepT3u1z37qCilgcTYDQTCy30\\r\\nwy06cnmtS7DnV/x+FOPA6WsIVVhaJ5Vj6LesvuOC93hRoMxWkbNYuLnEAPiqbxCy\\r\\nFe7fzRIylUI5d6P2x2wsHdrW8ReWCGqimi//tAk= generated-by-azure\\r\\n\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXMvc3Noa2V5MT9hcGktdmVyc2lvbj0yMDIwLTEyLTAx", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "7ab82ea5-b0bf-4ad8-a340-7b2847ffd761" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/LowCostGet3Min;3998,Microsoft.Compute/LowCostGet30Min;31998" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "ce9eeeac-47dc-409d-91db-f513cb560a52" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-correlation-request-id": [ + "03d903f8-ab85-4554-8260-b1d217197e78" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195229Z:03d903f8-ab85-4554-8260-b1d217197e78" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:28 GMT" + ], + "Content-Length": [ + "846" + ], + "Content-Type": [ + "application/json; charset=utf-8" + ], + "Expires": [ + "-1" + ] + }, + "ResponseBody": "{\r\n \"name\": \"sshkey1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/CRPTESTPS4815/providers/Microsoft.Compute/sshPublicKeys/sshkey1\",\r\n \"location\": \"westus\",\r\n \"properties\": {\r\n \"publicKey\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCqBcuHMD5lQOLwLOHod52eiEy1\\r\\n5E12HkWz53PN9WI19T50uo1lSSVVBjkW2WZBlbPTSh/k/0qL3027z6x0mLhnyaOv\\r\\nDNqX/4RuexOLZaJYqTisszuRlcZW58WEOrvTlJ1+6ycMPWTL8iFH6trEGu1Ll8Nz\\r\\n0J3nT2DH3Xr01Dy12mQKLuXrhns5ybRHy0IzGtwkcL7wpFI1cVqQiKibPZbSd9Vd\\r\\nT+7Jtz3r/pSYQa/HRO39A8c60fB3wP7fLz0kQl+6TKtDdWtRgN0cQpRYrMa4kJjT\\r\\nRYUUyDz2f/8+i9CWoHPbA/9C9PXzPVdnLWQt0k9rzqaU8BDqP0IngjeYCkwxYRy4\\r\\nrTTxnBNfOTns5uwW0ppPVXNKtkylkqSpbKXCeTZgepT3u1z37qCilgcTYDQTCy30\\r\\nwy06cnmtS7DnV/x+FOPA6WsIVVhaJ5Vj6LesvuOC93hRoMxWkbNYuLnEAPiqbxCy\\r\\nFe7fzRIylUI5d6P2x2wsHdrW8ReWCGqimi//tAk= generated-by-azure\\r\\n\"\r\n }\r\n}", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/crptestps4815/providers/Microsoft.Compute/sshPublicKeys/sshkey2?api-version=2020-12-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2NycHRlc3RwczQ4MTUvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL3NzaFB1YmxpY0tleXMvc3Noa2V5Mj9hcGktdmVyc2lvbj0yMDIwLTEyLTAx", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "94258e7d-3f77-46ee-b3c6-2bb478510cea" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Compute.ComputeManagementClient/46.0.0" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-resource": [ + "Microsoft.Compute/PutDeleteSshPublicKeys3Min;116,Microsoft.Compute/PutDeleteSshPublicKeys30Min;596" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "x-ms-request-id": [ + "7447c697-f458-496b-829e-17a2c7567857" + ], + "Server": [ + "Microsoft-HTTPAPI/2.0", + "Microsoft-HTTPAPI/2.0" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-correlation-request-id": [ + "04fe5558-28b1-4141-97d9-c1d5e35d9f67" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195230Z:04fe5558-28b1-4141-97d9-c1d5e35d9f67" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:30 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourcegroups/crptestps4815?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlZ3JvdXBzL2NycHRlc3RwczQ4MTU/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "DELETE", + "RequestBody": "", + "RequestHeaders": { + "x-ms-client-request-id": [ + "af6d78bb-ac81-4f6f-be2b-8a5856cc727c" + ], + "Accept-Language": [ + "en-US" + ], + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-deletes": [ + "14999" + ], + "x-ms-request-id": [ + "e1767097-9463-4bb1-9bfb-28e7d1e3ffdd" + ], + "x-ms-correlation-request-id": [ + "e1767097-9463-4bb1-9bfb-28e7d1e3ffdd" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195232Z:e1767097-9463-4bb1-9bfb-28e7d1e3ffdd" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:31 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11999" + ], + "x-ms-request-id": [ + "723d6ccb-8884-44a1-945c-bc12919d156e" + ], + "x-ms-correlation-request-id": [ + "723d6ccb-8884-44a1-945c-bc12919d156e" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195247Z:723d6ccb-8884-44a1-945c-bc12919d156e" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:52:46 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11998" + ], + "x-ms-request-id": [ + "59164aa9-632a-4994-a8e5-aed80c9b3e00" + ], + "x-ms-correlation-request-id": [ + "59164aa9-632a-4994-a8e5-aed80c9b3e00" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195302Z:59164aa9-632a-4994-a8e5-aed80c9b3e00" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:53:01 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11997" + ], + "x-ms-request-id": [ + "38de9afe-2208-479a-82c6-059b669aaff1" + ], + "x-ms-correlation-request-id": [ + "38de9afe-2208-479a-82c6-059b669aaff1" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195317Z:38de9afe-2208-479a-82c6-059b669aaff1" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:53:16 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11996" + ], + "x-ms-request-id": [ + "9ff76d8b-9ffb-425b-aea5-0cef88d1c0a5" + ], + "x-ms-correlation-request-id": [ + "9ff76d8b-9ffb-425b-aea5-0cef88d1c0a5" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195332Z:9ff76d8b-9ffb-425b-aea5-0cef88d1c0a5" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:53:32 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11995" + ], + "x-ms-request-id": [ + "11f2a401-c99d-40cd-8ad4-ae54031a623d" + ], + "x-ms-correlation-request-id": [ + "11f2a401-c99d-40cd-8ad4-ae54031a623d" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195347Z:11f2a401-c99d-40cd-8ad4-ae54031a623d" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:53:47 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "Location": [ + "https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01" + ], + "Retry-After": [ + "15" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11994" + ], + "x-ms-request-id": [ + "d3ded365-b5a8-4f10-b302-8d2a071df609" + ], + "x-ms-correlation-request-id": [ + "d3ded365-b5a8-4f10-b302-8d2a071df609" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195402Z:d3ded365-b5a8-4f10-b302-8d2a071df609" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:54:02 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 202 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11993" + ], + "x-ms-request-id": [ + "8a87340e-c3ae-4503-b71b-d8dc396a88aa" + ], + "x-ms-correlation-request-id": [ + "8a87340e-c3ae-4503-b71b-d8dc396a88aa" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195417Z:8a87340e-c3ae-4503-b71b-d8dc396a88aa" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:54:17 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + }, + { + "RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DUlBURVNUUFM0ODE1LVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2016-09-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL29wZXJhdGlvbnJlc3VsdHMvZXlKcWIySkpaQ0k2SWxKRlUwOVZVa05GUjFKUFZWQkVSVXhGVkVsUFRrcFBRaTFEVWxCVVJWTlVVRk0wT0RFMUxWZEZVMVJWVXlJc0ltcHZZa3h2WTJGMGFXOXVJam9pZDJWemRIVnpJbjA/YXBpLXZlcnNpb249MjAxNi0wOS0wMQ==", + "RequestMethod": "GET", + "RequestBody": "", + "RequestHeaders": { + "User-Agent": [ + "FxVersion/4.6.30015.01", + "OSName/Windows", + "OSVersion/Microsoft.Windows.10.0.19043.", + "Microsoft.Azure.Management.Internal.Resources.ResourceManagementClient/1.3.34" + ] + }, + "ResponseHeaders": { + "Cache-Control": [ + "no-cache" + ], + "Pragma": [ + "no-cache" + ], + "x-ms-ratelimit-remaining-subscription-reads": [ + "11992" + ], + "x-ms-request-id": [ + "ae1811f5-2d3b-45c9-934f-458e17b45855" + ], + "x-ms-correlation-request-id": [ + "ae1811f5-2d3b-45c9-934f-458e17b45855" + ], + "x-ms-routing-request-id": [ + "SOUTHCENTRALUS:20210527T195418Z:ae1811f5-2d3b-45c9-934f-458e17b45855" + ], + "Strict-Transport-Security": [ + "max-age=31536000; includeSubDomains" + ], + "X-Content-Type-Options": [ + "nosniff" + ], + "Date": [ + "Thu, 27 May 2021 19:54:17 GMT" + ], + "Expires": [ + "-1" + ], + "Content-Length": [ + "0" + ] + }, + "ResponseBody": "", + "StatusCode": 200 + } + ], + "Names": { + "Test-SshKey": [ + "crptestps4815" + ] + }, + "Variables": { + "SubscriptionId": "e37510d7-33b6-4676-886f-ee75bcc01871" + } +} \ No newline at end of file diff --git a/src/Compute/Compute/Az.Compute.psd1 b/src/Compute/Compute/Az.Compute.psd1 index 15a64b8804eb..2e4310d8da1b 100644 --- a/src/Compute/Compute/Az.Compute.psd1 +++ b/src/Compute/Compute/Az.Compute.psd1 @@ -168,7 +168,7 @@ CmdletsToExport = 'Remove-AzAvailabilitySet', 'Get-AzAvailabilitySet', 'Remove-AzDiskAccess', 'Get-AzDiskAccess', 'Invoke-AzVmPatchAssessment', 'Get-AzDiskEncryptionSetAssociatedResource', - 'Start-AzVmssRollingExtensionUpgrade', 'Invoke-AzVmInstallPatch' + 'Start-AzVmssRollingExtensionUpgrade', 'Invoke-AzVmInstallPatch', 'Get-AzSshKey', 'Remove-AzSshkey', 'Update-AzSshKey', 'New-AzSshKey' # Variables to export from this module # VariablesToExport = @() diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index c77f03dccefb..1722bd87a09c 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -32,6 +32,11 @@ - `New-AzVM` - `New-AzVmssConfig` - `New-AzVMSS` +* Added cmdlets to create, update, delete, and get new Azure resource: Ssh Public Key + - `New-AzSshKey` + - `Remove-AzSshKey` + - `Get-AzSshKey` + - `Update-AzSshKey` ## Version 4.12.0 * Updated the `Set-AzVMDiskEncryptionExtension` cmdlet to support ADE extension migration from two pass (version with AAD input parameters) to single pass (version without AAD input parameters). diff --git a/src/Compute/Compute/Common/ComputeClientBaseCmdlet.cs b/src/Compute/Compute/Common/ComputeClientBaseCmdlet.cs index 8edd329ecf63..db55f9f3a2c2 100644 --- a/src/Compute/Compute/Common/ComputeClientBaseCmdlet.cs +++ b/src/Compute/Compute/Common/ComputeClientBaseCmdlet.cs @@ -19,6 +19,9 @@ using Microsoft.Azure.Commands.Compute.Common; using Microsoft.Azure.Commands.ResourceManager.Common; using Microsoft.Azure.Management.Compute.Models; +using Microsoft.Azure.Management.Internal.Resources; +using Microsoft.Azure.Commands.Common.Authentication; +using Microsoft.Azure.Commands.Common.Authentication.Abstractions; namespace Microsoft.Azure.Commands.Compute { @@ -124,6 +127,23 @@ public static ManagedDiskParameters SetManagedDisk(string managedDiskId, string return managedDisk; } + + private ResourceManagementClient _armClient; + + public ResourceManagementClient ArmClient + { + get + { + return this._armClient ?? + (this._armClient = AzureSession.Instance.ClientFactory.CreateArmClient( + context: this.DefaultContext, + endpoint: AzureEnvironment.Endpoint.ResourceManager)); + } + set + { + this._armClient = value; + } + } } } diff --git a/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs b/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs index 6e625c887366..1d2504b47b20 100644 --- a/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs +++ b/src/Compute/Compute/Generated/ComputeAutomationBaseCmdlet.cs @@ -122,6 +122,14 @@ public IDiskAccessesOperations DiskAccessesClient } } + public ISshPublicKeysOperations SshPublicKeyClient + { + get + { + return ComputeClient.ComputeManagementClient.SshPublicKeys; + } + } + public IGalleriesOperations GalleriesClient { get diff --git a/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs b/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs index da2a22bf38fb..50611942e6a5 100644 --- a/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs +++ b/src/Compute/Compute/Generated/Models/ComputeAutoMapperProfile.cs @@ -186,7 +186,11 @@ private static void Initialize() cfg.CreateMap(); cfg.CreateMap(); cfg.CreateMap(); - + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); + cfg.CreateMap(); }); _mapper = config.CreateMapper(); } diff --git a/src/Compute/Compute/Models/PSSshPublicKeyResource.cs b/src/Compute/Compute/Models/PSSshPublicKeyResource.cs new file mode 100644 index 000000000000..5ae99b3ecbd6 --- /dev/null +++ b/src/Compute/Compute/Models/PSSshPublicKeyResource.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Text.RegularExpressions; +using Microsoft.Azure.Management.Compute.Models; + +namespace Microsoft.Azure.Commands.Compute.Automation.Models +{ + public class PSSshPublicKeyResource + { + public string Name { get; set; } + public string Location { get; set; } + public string Id { get; set; } + public string publicKey { get; set; } + public string Type { get; set; } + public IDictionary Tags { get; set; } + } +} diff --git a/src/Compute/Compute/Models/PSSshPublicKeyResourceList.cs b/src/Compute/Compute/Models/PSSshPublicKeyResourceList.cs new file mode 100644 index 000000000000..f15cdf2a7f7c --- /dev/null +++ b/src/Compute/Compute/Models/PSSshPublicKeyResourceList.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.Azure.Commands.Compute.Automation.Models +{ + public class PSSshPublicKeyResourceList : PSSshPublicKeyResource + { + public PSSshPublicKeyResource ToPSSshPublicKeyResource() + { + return ComputeAutomationAutoMapperProfile.Mapper.Map(this); + } + } +} diff --git a/src/Compute/Compute/Usage/GetAzureSshKey.cs b/src/Compute/Compute/Usage/GetAzureSshKey.cs new file mode 100644 index 000000000000..f54c80eab48a --- /dev/null +++ b/src/Compute/Compute/Usage/GetAzureSshKey.cs @@ -0,0 +1,115 @@ + +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Automation.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Compute; +using Microsoft.Azure.Management.Compute.Models; + +namespace Microsoft.Azure.Commands.Compute.Automation +{ + [Cmdlet(VerbsCommon.Get, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SshKey", SupportsShouldProcess = true, DefaultParameterSetName = DefaultParameterSet)] + [OutputType(typeof(PSSshPublicKeyResource))] + public partial class GetAzureSshKey : ComputeAutomationBaseCmdlet + { + private const string DefaultParameterSet = "DefaultParameterSet"; + private const string ResourceIDParameterSet = "ResourceIDParameterSet"; + + [Parameter( + Mandatory = false, + ParameterSetName = DefaultParameterSet, + ValueFromPipelineByPropertyName = true)] + [ResourceGroupCompleter] + [SupportsWildcards] + public string ResourceGroupName { get; set; } + + [Parameter( + Mandatory = false, + ParameterSetName = DefaultParameterSet, + ValueFromPipelineByPropertyName = true)] + [ResourceNameCompleter("Microsoft.Compute/SshPublicKeys", "ResourceGroupName")] + [SupportsWildcards] + [Alias("sshkeyName")] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + ParameterSetName = ResourceIDParameterSet, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Resource ID for your SSH Public Key Resource.")] + [ResourceIdCompleter("Microsoft.Compute/sshPublicKeys")] + public string ResourceId { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + ExecuteClientAction(() => + { + string resourceGroupName; + string sshKeyName; + + if (this.ParameterSetName == ResourceIDParameterSet) + { + resourceGroupName = GetResourceGroupName(this.ResourceId); + sshKeyName = GetResourceName(this.ResourceId, "Microsoft.Compute/sshPublicKeys"); + } + else + { + resourceGroupName = this.ResourceGroupName; + sshKeyName = this.Name; + } + + if (ShouldGetByName(resourceGroupName, sshKeyName)) + { + var result = SshPublicKeyClient.Get(resourceGroupName, sshKeyName); + var psObject = new PSSshPublicKeyResource(); + ComputeAutomationAutoMapperProfile.Mapper.Map(result, psObject); + WriteObject(psObject); + } + else if (ShouldListByResourceGroup(resourceGroupName, sshKeyName)) + { + var result = SshPublicKeyClient.ListByResourceGroup(resourceGroupName); + var resultList = result.ToList(); + var nextPageLink = result.NextPageLink; + while (!string.IsNullOrEmpty(nextPageLink)) + { + var pageResult = SshPublicKeyClient.ListByResourceGroupNext(nextPageLink); + foreach (var pageItem in pageResult) + { + resultList.Add(pageItem); + } + nextPageLink = pageResult.NextPageLink; + } + var psObject = new List(); + foreach (var r in resultList) + { + psObject.Add(ComputeAutomationAutoMapperProfile.Mapper.Map(r)); + } + WriteObject(TopLevelWildcardFilter(resourceGroupName, sshKeyName, psObject), true); + } + else + { + var result = SshPublicKeyClient.ListBySubscription(); + var resultList = result.ToList(); + var nextPageLink = result.NextPageLink; + while (!string.IsNullOrEmpty(nextPageLink)) + { + var pageResult = SshPublicKeyClient.ListBySubscriptionNext(nextPageLink); + foreach (var pageItem in pageResult) + { + resultList.Add(pageItem); + } + nextPageLink = pageResult.NextPageLink; + } + var psObject = new List(); + foreach (var r in resultList) + { + psObject.Add(ComputeAutomationAutoMapperProfile.Mapper.Map(r)); + } + WriteObject(TopLevelWildcardFilter(resourceGroupName, sshKeyName, psObject), true); + } + }); + } + } +} diff --git a/src/Compute/Compute/Usage/NewAzureSshKey.cs b/src/Compute/Compute/Usage/NewAzureSshKey.cs new file mode 100644 index 000000000000..3a656105bebd --- /dev/null +++ b/src/Compute/Compute/Usage/NewAzureSshKey.cs @@ -0,0 +1,96 @@ +using System; +using System.IO; +using System.Text; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Automation.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Compute; +using Microsoft.Azure.Management.Compute.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Microsoft.Azure.Management.Internal.Resources; +using Microsoft.Azure.Management.Internal.Resources.Models; + +namespace Microsoft.Azure.Commands.Compute.Automation +{ + [Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SshKey", SupportsShouldProcess = true)] + [OutputType(typeof(PSSshPublicKeyResource))] + public partial class NewAzureSshKey : ComputeAutomationBaseCmdlet + { + + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true)] + [ResourceGroupCompleter] + [SupportsWildcards] + public string ResourceGroupName { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true)] + [ResourceNameCompleter("Microsoft.Compute/SshPublicKeys", "ResourceGroupName")] + [SupportsWildcards] + [Alias("sshkeyName")] + public string Name { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true)] + public string PublicKey { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + ExecuteClientAction(() => + { + string resourceGroupName = this.ResourceGroupName; + string sshKeyName = this.Name; + SshPublicKeyResource result; + SshPublicKeyResource sshkey = new SshPublicKeyResource(); + ResourceGroup rg = ArmClient.ResourceGroups.Get(resourceGroupName); + sshkey.Location = rg.Location; + + if (this.IsParameterBound(c => c.PublicKey)) + { + + sshkey.PublicKey = this.PublicKey; + result = SshPublicKeyClient.Create(resourceGroupName, sshKeyName, sshkey); + } + else + { + WriteDebug("No public key is provided. A key pair is being generated for you."); + + result = SshPublicKeyClient.Create(resourceGroupName, sshKeyName, sshkey); + SshPublicKeyGenerateKeyPairResult keypair = SshPublicKeyClient.GenerateKeyPair(resourceGroupName, sshKeyName); + result.PublicKey = keypair.PublicKey; + + string sshFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".ssh" ); + if (!Directory.Exists(sshFolder)) + { + Directory.CreateDirectory(sshFolder); + } + + DateTimeOffset now = DateTimeOffset.UtcNow; + string privateKeyFileName = now.ToUnixTimeSeconds().ToString(); + string publicKeyFileName = now.ToUnixTimeSeconds().ToString() + ".pub"; + string privateKeyFilePath = Path.Combine(sshFolder + privateKeyFileName); + string publicKeyFilePath = Path.Combine(sshFolder + publicKeyFileName); + using (StreamWriter writer = new StreamWriter(privateKeyFilePath)) + { + writer.WriteLine(keypair.PrivateKey); + } + Console.WriteLine("Private key is saved to " + privateKeyFilePath); + + using (StreamWriter writer = new StreamWriter(publicKeyFilePath)) + { + writer.WriteLine(keypair.PublicKey); + } + Console.WriteLine("Public key is saved to " + publicKeyFilePath); + } + + var psObject = new PSSshPublicKeyResource(); + ComputeAutomationAutoMapperProfile.Mapper.Map(result, psObject); + WriteObject(psObject); + }); + } + } +} diff --git a/src/Compute/Compute/Usage/RemoveAzureSshKey.cs b/src/Compute/Compute/Usage/RemoveAzureSshKey.cs new file mode 100644 index 000000000000..b6fa6e58be7e --- /dev/null +++ b/src/Compute/Compute/Usage/RemoveAzureSshKey.cs @@ -0,0 +1,93 @@ +using System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Automation.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Compute; +using Microsoft.Azure.Management.Compute.Models; + +namespace Microsoft.Azure.Commands.Compute.Automation +{ + [Cmdlet(VerbsCommon.Remove, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SshKey", SupportsShouldProcess = true, DefaultParameterSetName = DefaultParameterSet)] + [OutputType(typeof(PSOperationStatusResponse))] + public partial class RemoveAzureSshKey : ComputeAutomationBaseCmdlet + { + private const string DefaultParameterSet = "DefaultParameterSet"; + private const string InputObjectParameterSet = "InputObjectParameterSet"; + private const string ResourceIDParameterSet = "ResourceIDParameterSet"; + + [Parameter( + Mandatory = true, + ParameterSetName = DefaultParameterSet, + ValueFromPipelineByPropertyName = true)] + [ResourceGroupCompleter] + [SupportsWildcards] + public string ResourceGroupName { get; set; } + + [Parameter( + Mandatory = true, + ParameterSetName = DefaultParameterSet, + ValueFromPipelineByPropertyName = true)] + [ResourceNameCompleter("Microsoft.Compute/SshPublicKeys", "ResourceGroupName")] + [SupportsWildcards] + [Alias("sshkeyName")] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + ParameterSetName = ResourceIDParameterSet, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Resource ID for your SSH Public Key Resource.")] + [ResourceIdCompleter("Microsoft.Compute/SshPublicKeys")] + public string ResourceId { get; set; } + + [Alias("SshKey")] + [Parameter( + Mandatory = true, + ParameterSetName = InputObjectParameterSet, + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true, + HelpMessage = "PowerShell Ssh Public Key Object")] + [ValidateNotNullOrEmpty] + public PSSshPublicKeyResource InputObject { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + ExecuteClientAction(() => + { + string resourceGroupName; + string sshKeyName; + + switch (this.ParameterSetName) + { + case ResourceIDParameterSet: + resourceGroupName = GetResourceGroupName(this.ResourceId); + sshKeyName = GetResourceName(this.ResourceId, "Microsoft.Compute/SshPublicKeys"); + break; + case InputObjectParameterSet: + resourceGroupName = GetResourceGroupName(this.InputObject.Id); + sshKeyName = GetResourceName(this.InputObject.Id, "Microsoft.Compute/SshPublicKeys"); + break; + default: + resourceGroupName = this.ResourceGroupName; + sshKeyName = this.Name; + break; + } + + var result = SshPublicKeyClient.DeleteWithHttpMessagesAsync(resourceGroupName, sshKeyName).GetAwaiter().GetResult(); + PSOperationStatusResponse output = new PSOperationStatusResponse + { + StartTime = this.StartTime, + EndTime = DateTime.Now + }; + + if (result != null && result.Request != null && result.Request.RequestUri != null) + { + output.Name = result.Request.RequestUri.ToString(); + } + + WriteObject(output); + }); + } + } +} diff --git a/src/Compute/Compute/Usage/UpdateAzureSshKey.cs b/src/Compute/Compute/Usage/UpdateAzureSshKey.cs new file mode 100644 index 000000000000..8cbf36863329 --- /dev/null +++ b/src/Compute/Compute/Usage/UpdateAzureSshKey.cs @@ -0,0 +1,94 @@ +using System; +using System.Management.Automation; +using Microsoft.Azure.Commands.Compute.Automation.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Compute; +using Microsoft.Azure.Management.Compute.Models; + +namespace Microsoft.Azure.Commands.Compute.Automation +{ + [Cmdlet("Update", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "SshKey", SupportsShouldProcess = true, DefaultParameterSetName = DefaultParameterSet)] + [OutputType(typeof(PSSshPublicKeyResource))] + public partial class UpdateAzureSshKey : ComputeAutomationBaseCmdlet + { + + private const string DefaultParameterSet = "DefaultParameterSet"; + private const string InputObjectParameterSet = "InputObjectParameterSet"; + private const string ResourceIDParameterSet = "ResourceIDParameterSet"; + + [Parameter( + Mandatory = true, + ParameterSetName = DefaultParameterSet, + ValueFromPipelineByPropertyName = true)] + [ResourceGroupCompleter] + [SupportsWildcards] + public string ResourceGroupName { get; set; } + + [Parameter( + Mandatory = true, + ParameterSetName = DefaultParameterSet, + ValueFromPipelineByPropertyName = true)] + [ResourceNameCompleter("Microsoft.Compute/SshPublicKeys", "ResourceGroupName")] + [SupportsWildcards] + [Alias("sshkeyName")] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + ParameterSetName = ResourceIDParameterSet, + ValueFromPipelineByPropertyName = true, + HelpMessage = "Resource ID for your SSH Public Key Resource.")] + [ResourceIdCompleter("Microsoft.Compute/SshPublicKeys")] + public string ResourceId { get; set; } + + [Alias("SshKey")] + [Parameter( + Mandatory = true, + ParameterSetName = InputObjectParameterSet, + ValueFromPipeline = true, + ValueFromPipelineByPropertyName = true, + HelpMessage = "PowerShell Ssh Public Key Object")] + [ValidateNotNullOrEmpty] + public PSSshPublicKeyResource InputObject { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true)] + public string PublicKey { get; set; } + + public override void ExecuteCmdlet() + { + base.ExecuteCmdlet(); + ExecuteClientAction(() => + { + string resourceGroupName; + string sshKeyName; + string publicKey = this.PublicKey; + + switch (this.ParameterSetName) + { + case ResourceIDParameterSet: + resourceGroupName = GetResourceGroupName(this.ResourceId); + sshKeyName = GetResourceName(this.ResourceId, "Microsoft.Compute/SshPublicKeys"); + break; + case InputObjectParameterSet: + resourceGroupName = GetResourceGroupName(this.InputObject.Id); + sshKeyName = GetResourceName(this.InputObject.Id, "Microsoft.Compute/SshPublicKeys"); + break; + default: + resourceGroupName = this.ResourceGroupName; + sshKeyName = this.Name; + break; + } + + SshPublicKeyUpdateResource sshkeyUpdateResource = new SshPublicKeyUpdateResource(); + sshkeyUpdateResource.PublicKey = publicKey; + var result = SshPublicKeyClient.Update(resourceGroupName, sshKeyName, sshkeyUpdateResource); + var psObject = new PSSshPublicKeyResource(); + ComputeAutomationAutoMapperProfile.Mapper.Map(result, psObject); + WriteObject(psObject); + + }); + } + } +} diff --git a/src/Compute/Compute/help/Az.Compute.md b/src/Compute/Compute/help/Az.Compute.md index 4244729087ea..aaed2f4505e6 100644 --- a/src/Compute/Compute/help/Az.Compute.md +++ b/src/Compute/Compute/help/Az.Compute.md @@ -11,9 +11,6 @@ Locale: en-US This topic displays the help topics for the Azure Compute Cmdlets. ## Az.Compute Cmdlets -### [Add-AzContainerServiceAgentPoolProfile](Add-AzContainerServiceAgentPoolProfile.md) -Adds a container service agent pool profile. - ### [Add-AzImageDataDisk](Add-AzImageDataDisk.md) Adds a data disk to an image object. @@ -83,9 +80,6 @@ Gets Azure availability sets in a resource group. ### [Get-AzComputeResourceSku](Get-AzComputeResourceSku.md) List all compute resource Skus -### [Get-AzContainerService](Get-AzContainerService.md) -Gets a container service. - ### [Get-AzDisk](Get-AzDisk.md) Gets the properties of a Managed disk. @@ -95,6 +89,9 @@ Gets the properties of Disk Accesses ### [Get-AzDiskEncryptionSet](Get-AzDiskEncryptionSet.md) Get or list disk encryption sets. +### [Get-AzDiskEncryptionSetAssociatedResource](Get-AzDiskEncryptionSetAssociatedResource.md) +Gets the list of resources associated with the specified disk encryption set. + ### [Get-AzGallery](Get-AzGallery.md) Get or list galleries. @@ -122,6 +119,9 @@ Gets an .rdp file. ### [Get-AzSnapshot](Get-AzSnapshot.md) Gets the properties of a snapshot +### [Get-AzSshKey](Get-AzSshKey.md) +{{ Fill in the Synopsis }} + ### [Get-AzVM](Get-AzVM.md) Gets the properties of a virtual machine. @@ -212,6 +212,9 @@ Grants an access to a disk. ### [Grant-AzSnapshotAccess](Grant-AzSnapshotAccess.md) Grants an access to a snapshot. +### [Invoke-AzVMInstallPatch](Invoke-AzVMInstallPatch.md) +Installs patches on the VM + ### [Invoke-AzVMPatchAssessment](Invoke-AzVMPatchAssessment.md) Assess patch state of a virtual machine. @@ -227,12 +230,6 @@ Run command on the Virtual Machine Scale Set VM. ### [New-AzAvailabilitySet](New-AzAvailabilitySet.md) Creates an Azure availability set. -### [New-AzContainerService](New-AzContainerService.md) -Creates a container service. - -### [New-AzContainerServiceConfig](New-AzContainerServiceConfig.md) -Creates a local configuration object for a container service. - ### [New-AzDisk](New-AzDisk.md) Creates a managed disk. @@ -284,6 +281,9 @@ Creates a configurable snapshot object. ### [New-AzSnapshotUpdateConfig](New-AzSnapshotUpdateConfig.md) Creates a configurable snapshot update object. +### [New-AzSshKey](New-AzSshKey.md) +{{ Fill in the Synopsis }} + ### [New-AzVM](New-AzVM.md) Creates a virtual machine. @@ -323,12 +323,6 @@ Uploads a DSC script to Azure blob storage. ### [Remove-AzAvailabilitySet](Remove-AzAvailabilitySet.md) Removes an availability set from Azure. -### [Remove-AzContainerService](Remove-AzContainerService.md) -Removes a container service. - -### [Remove-AzContainerServiceAgentPoolProfile](Remove-AzContainerServiceAgentPoolProfile.md) -Removes an agent pool profile from a container service. - ### [Remove-AzDisk](Remove-AzDisk.md) Removes a disk. @@ -365,6 +359,9 @@ Delete Proximity Placement Group resource. ### [Remove-AzSnapshot](Remove-AzSnapshot.md) Removes a snapshot. +### [Remove-AzSshKey](Remove-AzSshKey.md) +{{ Fill in the Synopsis }} + ### [Remove-AzVM](Remove-AzVM.md) Removes a virtual machine from Azure. @@ -530,6 +527,9 @@ Sets the operating system disk properties on a virtual machine. ### [Set-AzVMPlan](Set-AzVMPlan.md) Sets the Marketplace plan information on a virtual machine. +### [Set-AzVMSecurityProfile](Set-AzVMSecurityProfile.md) +Sets the SecurityType enum for Virtual Machines. + ### [Set-AzVMSourceImage](Set-AzVMSourceImage.md) Specifies the image for a virtual machine. @@ -554,18 +554,30 @@ Sets the VMSS operating system profile properties. ### [Set-AzVmssRollingUpgradePolicy](Set-AzVmssRollingUpgradePolicy.md) Sets the VMSS rolling upgrade policy properties. +### [Set-AzVmssSecurityProfile](Set-AzVmssSecurityProfile.md) +This cmdlet allows users to set the SecurityType enum for Virtual Machines scale sets. + ### [Set-AzVmssStorageProfile](Set-AzVmssStorageProfile.md) Sets the storage profile properties for the VMSS. +### [Set-AzVmssUefi](Set-AzVmssUefi.md) +Modifies UEFI properties of gen 2 virtual machines that are part of virtual machine scale sets + ### [Set-AzVmssVM](Set-AzVmssVM.md) Modifies the state of a VMSS instance. +### [Set-AzVMUefi](Set-AzVMUefi.md) +Modifies UEFI properties of a gen 2 virtual machine + ### [Start-AzVM](Start-AzVM.md) Starts an Azure virtual machine. ### [Start-AzVmss](Start-AzVmss.md) Starts the VMSS or a set of virtual machines within the VMSS. +### [Start-AzVmssRollingExtensionUpgrade](Start-AzVmssRollingExtensionUpgrade.md) +This cmdlet starts a rolling upgrade for all extensions on the given Virtual Machine Scale Set to the latest available version. + ### [Start-AzVmssRollingOSUpgrade](Start-AzVmssRollingOSUpgrade.md) Starts a rolling upgrade to move all virtual machine scale set instances to the latest available Platform Image OS version. @@ -584,9 +596,6 @@ Checks the configuration of the AEM extension. ### [Update-AzAvailabilitySet](Update-AzAvailabilitySet.md) Updates an availability set. -### [Update-AzContainerService](Update-AzContainerService.md) -Updates the state of a container service. - ### [Update-AzDisk](Update-AzDisk.md) Updates a disk. @@ -608,6 +617,9 @@ Updates an image. ### [Update-AzSnapshot](Update-AzSnapshot.md) Updates a snapshot. +### [Update-AzSshKey](Update-AzSshKey.md) +{{ Fill in the Synopsis }} + ### [Update-AzVM](Update-AzVM.md) Updates the state of an Azure virtual machine. diff --git a/src/Compute/Compute/help/Get-AzSshKey.md b/src/Compute/Compute/help/Get-AzSshKey.md new file mode 100644 index 000000000000..c97948560d60 --- /dev/null +++ b/src/Compute/Compute/help/Get-AzSshKey.md @@ -0,0 +1,127 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://docs.microsoft.com/powershell/module/az.compute/get-azsshkey +schema: 2.0.0 +--- + +# Get-AzSshKey + +## SYNOPSIS +Gets the properties of SSH Public Key resources. + +## SYNTAX + +### DefaultParameterSet (Default) +``` +Get-AzSshKey [-ResourceGroupName ] [-Name ] [-DefaultProfile ] + [] +``` + +### ResourceIDParameterSet +``` +Get-AzSshKey [-ResourceId] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the properties of SSH Public Key resources. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Get-AzSshKey -ResourceGroupName "testRG" -Name "SshKey1" +``` + +This example retrieves a specific Ssh Public Key resource. + +### Example 2 +```powershell +PS C:\> Get-AzSshKey -ResourceGroupName "testRG" +``` + +This example retrieves a list of Ssh Public Key resources that are in Resource Group: "testRG" + +### Example 3 +```powershell +PS C:\> Get-AzSshKey +``` + +This example retrieves all the Ssh Public Key resources in the subscription. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Specifies the name of the Ssh Public Key resource to get. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: sshkeyName + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -ResourceGroupName +Specifies the name of a resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -ResourceId +Resource ID for your SSH Public Key Resource. + +```yaml +Type: System.String +Parameter Sets: ResourceIDParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Automation.Models.PSSshPublicKeyResource + +## NOTES + +## RELATED LINKS diff --git a/src/Compute/Compute/help/New-AzSshKey.md b/src/Compute/Compute/help/New-AzSshKey.md new file mode 100644 index 000000000000..a896ef0a8f4f --- /dev/null +++ b/src/Compute/Compute/help/New-AzSshKey.md @@ -0,0 +1,114 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://docs.microsoft.com/powershell/module/az.compute/new-azsshkey +schema: 2.0.0 +--- + +# New-AzSshKey + +## SYNOPSIS +Create a SSH Public Key resource. + +## SYNTAX + +``` +New-AzSshKey -ResourceGroupName -Name [-PublicKey ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Create a SSH Public Key resource. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> New-AzSshKey -ResourceGroupName "testRG" -Name "sshkey1" -PublicKey $publicKey +``` + +Creating a SSH Key resource with provided a public key. + +### Example 2 +```powershell +PS C:\> New-AzSshKey -ResourceGroupName "testRG" -Name "sshkey1" +``` + +Creating a SSH Key resource without providing a public key. A key pair will be generated and saved in ~\.ssh. The public key will also be saved in the SSH Key resource. + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Specifies the name of the Ssh Public Key resource to get. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: sshkeyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -PublicKey +Public Key value. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceGroupName +Specifies the name of a resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Automation.Models.PSSshPublicKeyResource + +## NOTES + +## RELATED LINKS diff --git a/src/Compute/Compute/help/Remove-AzSshKey.md b/src/Compute/Compute/help/Remove-AzSshKey.md new file mode 100644 index 000000000000..c4fce9d9a129 --- /dev/null +++ b/src/Compute/Compute/help/Remove-AzSshKey.md @@ -0,0 +1,135 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://docs.microsoft.com/powershell/module/az.compute/remove-azsshkey +schema: 2.0.0 +--- + +# Remove-AzSshKey + +## SYNOPSIS +Delete a SSH Public Key resource. + +## SYNTAX + +### DefaultParameterSet (Default) +``` +Remove-AzSshKey -ResourceGroupName -Name [-DefaultProfile ] + [] +``` + +### ResourceIDParameterSet +``` +Remove-AzSshKey [-ResourceId] [-AsJob] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] +``` + +### InputObjectParameterSet +``` +Remove-AzSshKey [-InputObject] [-AsJob] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] +``` + +## DESCRIPTION +Delete a SSH Public Key resource. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> Remove-AzSshKey -ResourceGroupName "testRG" -Name "sshKey1" +``` + +Deletes Ssh Public Key resource named "sshKey1" in Resource Group "testRG" + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +PowerShell SSH Public Key Object + +```yaml +Type: Microsoft.Azure.Commands.Compute.Automation.Models.PSSshPublicKeyResource +Parameter Sets: InputObjectParameterSet +Aliases: SshKey + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Name +Specifies the name of the Ssh Public Key resource to get. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: sshkeyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -ResourceGroupName +Specifies the name of a resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -ResourceId +Resource ID for your SSH Public Key Resource. + +```yaml +Type: System.String +Parameter Sets: ResourceIDParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Automation.Models.PSOperationStatusResponse + +## NOTES + +## RELATED LINKS diff --git a/src/Compute/Compute/help/Update-AzSshKey.md b/src/Compute/Compute/help/Update-AzSshKey.md new file mode 100644 index 000000000000..e42d6c3842d2 --- /dev/null +++ b/src/Compute/Compute/help/Update-AzSshKey.md @@ -0,0 +1,152 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Compute.dll-Help.xml +Module Name: Az.Compute +online version: https://docs.microsoft.com/powershell/module/az.compute/update-azsshkey +schema: 2.0.0 +--- + +# Update-AzSshKey + +## SYNOPSIS +Update a SSH Public Key resource. + +## SYNTAX + +### DefaultParameterSet (Default) +``` +Update-AzSshKey -ResourceGroupName -Name -PublicKey + [-DefaultProfile ] [] +``` + +### ResourceIDParameterSet +``` +Update-AzSshKey [-ResourceId] -PublicKey [-AsJob] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] +``` + +### InputObjectParameterSet +``` +Update-AzSshKey[-InputObject] -PublicKey [-AsJob] [-DefaultProfile ] [-WhatIf] + [-Confirm] [] +``` + +## DESCRIPTION +Update a SSH Public Key resource. + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> $SshKey1 = Get-AzSshKey -ResourceGroupName "testRG" -Name "sshKey1" +PS C:\> Update-AzSshKey -ResourceGroupName "testRG" -Name "sshKey2" -PublicKey $SshKey1.publickey + +``` + +Updates the public key value of 'sshKey2' with public key value from 'sshKey1' + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +PowerShell SSH Public Key Object + +```yaml +Type: Microsoft.Azure.Commands.Compute.Automation.Models.PSSshPublicKeyResource +Parameter Sets: InputObjectParameterSet +Aliases: SshKey + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName, ByValue) +Accept wildcard characters: False +``` + +### -Name +Specifies the name of the Ssh Public Key resource to get. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: sshkeyName + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -PublicKey +Public Key value. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceGroupName +Specifies the name of a resource group. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: True +``` + +### -ResourceId +Resource ID for your SSH Public Key Resource. + +```yaml +Type: System.String +Parameter Sets: ResourceIDParameterSet +Aliases: + +Required: True +Position: 0 +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Compute.Automation.Models.PSSshPublicKeyResource + +## NOTES + +## RELATED LINKS