Skip to content

Commit cbbd0cc

Browse files
Sandidowyunchi-ms
andauthored
Confidential VM features in VM and Disk cmdlets (#18094)
* set-azvmsssecuritytype dev and test * test more * 5 of 6 devs * removing vmss work * setazvmosdisk * 2 tests/cmdlets done * diskdescurityprofile testing trying * test trying * trying tests * test cleanup * test eh * tests work * tests * name changes * test script issues * remove unused test * test rerecord * test stop running * new test withhout polciy file * trying test, some succ * igvm access * desid test script * wiki test success * test record arm client error * some attempts at testing * get object id of user * test stuff * test stuff * works with cli * codereview cleanup * codereview cleanup 2 * key vault trying * keyvault cleanup * test stuff * trying key stuff * test runner and key attempts * computetestrunner attempt * successful manual test * tests cleanup and done * changelog and help doc * vmss dev and test * disk encrypt type * remove vmss since half is non functional * remove vmss test * examples and clean kv changelog * remove vmss test * Update Set-AzVMOSDisk.md * Update examples * Update Set-AzVMOSDisk.md Co-authored-by: wyunchi-ms <[email protected]> Co-authored-by: Yunchi Wang <[email protected]> Co-authored-by: Yunchi Wang <[email protected]>
1 parent f968215 commit cbbd0cc

22 files changed

+22156
-22
lines changed

src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.cs

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,12 +507,54 @@ public void TestVirtualMachineGuestAttestation()
507507
{
508508
TestRunner.RunTestScript("Test-VirtualMachineGuestAttestation");
509509
}
510-
510+
511511
[Fact]
512512
[Trait(Category.AcceptanceType, Category.CheckIn)]
513513
public void TestVMandVMSSTimeCreated()
514514
{
515515
TestRunner.RunTestScript("Test-VMandVMSSTimeCreated");
516516
}
517+
518+
[Fact]
519+
[Trait(Category.AcceptanceType, Category.CheckIn)]
520+
public void TestConfidentialVMSetAzVmOsDisk()
521+
{
522+
TestRunner.RunTestScript("Test-ConfidentialVMSetAzVmOsDisk");
523+
}
524+
525+
[Fact]
526+
[Trait(Category.AcceptanceType, Category.CheckIn)]
527+
public void TestConfVMSetAzVMSecurityProfile()
528+
{
529+
TestRunner.RunTestScript("Test-ConfVMSetAzVMSecurityProfile");
530+
}
531+
532+
[Fact]
533+
[Trait(Category.AcceptanceType, Category.CheckIn)]
534+
public void TestConfVMSetAzDiskSecurityProfile()
535+
{
536+
TestRunner.RunTestScript("Test-ConfVMSetAzDiskSecurityProfile");
537+
}
538+
539+
[Fact]
540+
[Trait(Category.AcceptanceType, Category.CheckIn)]
541+
public void TestConfVMSetAzDiskEncryptionSetConfig()
542+
{
543+
TestRunner.RunTestScript("Test-ConfVMSetAzDiskEncryptionSetConfig");
544+
}
545+
546+
[Fact]
547+
[Trait(Category.AcceptanceType, Category.CheckIn)]
548+
public void TestConfVMSetAzDiskSecurityProfileNoDES()
549+
{
550+
TestRunner.RunTestScript("Test-ConfVMSetAzDiskSecurityProfileNoDES");
551+
}
552+
553+
[Fact]
554+
[Trait(Category.AcceptanceType, Category.CheckIn)]
555+
public void TestConfidentialVMSetAzVmOsDiskDesIdDiskWithVMGuestManual()
556+
{
557+
TestRunner.RunTestScript("Test-ManualConfidentialVMSetAzVmOsDiskDesIdDiskWithVMGuest");
558+
}
517559
}
518560
}

src/Compute/Compute.Test/ScenarioTests/VirtualMachineTests.ps1

Lines changed: 507 additions & 2 deletions
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,294 @@
1+
{
2+
"Entries": [
3+
{
4+
"RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.Compute/diskEncryptionSets/desadsanddescon1?api-version=2022-03-02",
5+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2Fkc2FuZGRlc2NvbjEvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL2Rpc2tFbmNyeXB0aW9uU2V0cy9kZXNhZHNhbmRkZXNjb24xP2FwaS12ZXJzaW9uPTIwMjItMDMtMDI=",
6+
"RequestMethod": "PUT",
7+
"RequestHeaders": {
8+
"x-ms-client-request-id": [
9+
"bd4865c4-ce75-40a8-b82c-5c2ebbf95e48"
10+
],
11+
"Accept-Language": [
12+
"en-US"
13+
],
14+
"User-Agent": [
15+
"FxVersion/4.700.22.36202",
16+
"OSName/Windows",
17+
"OSVersion/Microsoft.Windows.10.0.22000",
18+
"Microsoft.Azure.Management.Compute.ComputeManagementClient/57.0.0"
19+
],
20+
"Content-Type": [
21+
"application/json; charset=utf-8"
22+
],
23+
"Content-Length": [
24+
"514"
25+
]
26+
},
27+
"RequestBody": "{\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\"\r\n },\r\n \"properties\": {\r\n \"encryptionType\": \"ConfidentialVmEncryptedWithCustomerKey\",\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.KeyVault/vaults/kvadsanddescon1\"\r\n },\r\n \"keyUrl\": \"https://kvadsanddescon1.vault.azure.net/keys/kadsanddescon1/a07a0b98ac3c4139b627190699e0804e\"\r\n }\r\n },\r\n \"location\": \"northeurope\",\r\n \"tags\": {}\r\n}",
28+
"ResponseHeaders": {
29+
"Cache-Control": [
30+
"no-cache"
31+
],
32+
"Pragma": [
33+
"no-cache"
34+
],
35+
"Location": [
36+
"https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/providers/Microsoft.Compute/locations/northeurope/DiskOperations/492d4803-a084-4ca3-aebd-bdd8f3eaf7cf?p=f11d738a-f4d5-4518-b51f-678877a2640b&monitor=true&api-version=2022-03-02"
37+
],
38+
"Azure-AsyncOperation": [
39+
"https://management.azure.com/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/providers/Microsoft.Compute/locations/northeurope/DiskOperations/492d4803-a084-4ca3-aebd-bdd8f3eaf7cf?p=f11d738a-f4d5-4518-b51f-678877a2640b&api-version=2022-03-02"
40+
],
41+
"x-ms-ratelimit-remaining-resource": [
42+
"Microsoft.Compute/HighCostDiskEncryptionSet3Min;98,Microsoft.Compute/HighCostDiskEncryptionSet30Min;298"
43+
],
44+
"Strict-Transport-Security": [
45+
"max-age=31536000; includeSubDomains"
46+
],
47+
"x-ms-served-by": [
48+
"f11d738a-f4d5-4518-b51f-678877a2640b_132648252790131682"
49+
],
50+
"x-ms-request-id": [
51+
"492d4803-a084-4ca3-aebd-bdd8f3eaf7cf"
52+
],
53+
"Server": [
54+
"Microsoft-HTTPAPI/2.0",
55+
"Microsoft-HTTPAPI/2.0"
56+
],
57+
"x-ms-ratelimit-remaining-subscription-writes": [
58+
"1199"
59+
],
60+
"x-ms-correlation-request-id": [
61+
"f23c4fc4-9911-4ec1-a4db-7267b02bfeac"
62+
],
63+
"x-ms-routing-request-id": [
64+
"CENTRALUS:20220909T193745Z:f23c4fc4-9911-4ec1-a4db-7267b02bfeac"
65+
],
66+
"X-Content-Type-Options": [
67+
"nosniff"
68+
],
69+
"Date": [
70+
"Fri, 09 Sep 2022 19:37:44 GMT"
71+
],
72+
"Content-Length": [
73+
"552"
74+
],
75+
"Content-Type": [
76+
"application/json; charset=utf-8"
77+
],
78+
"Expires": [
79+
"-1"
80+
]
81+
},
82+
"ResponseBody": "{\r\n \"location\": \"northeurope\",\r\n \"tags\": {},\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\"\r\n },\r\n \"properties\": {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.KeyVault/vaults/kvadsanddescon1\"\r\n },\r\n \"keyUrl\": \"https://kvadsanddescon1.vault.azure.net/keys/kadsanddescon1/a07a0b98ac3c4139b627190699e0804e\"\r\n },\r\n \"encryptionType\": \"ConfidentialVmEncryptedWithCustomerKey\",\r\n \"provisioningState\": \"Updating\"\r\n }\r\n}",
83+
"StatusCode": 202
84+
},
85+
{
86+
"RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/providers/Microsoft.Compute/locations/northeurope/DiskOperations/492d4803-a084-4ca3-aebd-bdd8f3eaf7cf?p=f11d738a-f4d5-4518-b51f-678877a2640b&api-version=2022-03-02",
87+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Byb3ZpZGVycy9NaWNyb3NvZnQuQ29tcHV0ZS9sb2NhdGlvbnMvbm9ydGhldXJvcGUvRGlza09wZXJhdGlvbnMvNDkyZDQ4MDMtYTA4NC00Y2EzLWFlYmQtYmRkOGYzZWFmN2NmP3A9ZjExZDczOGEtZjRkNS00NTE4LWI1MWYtNjc4ODc3YTI2NDBiJmFwaS12ZXJzaW9uPTIwMjItMDMtMDI=",
88+
"RequestMethod": "GET",
89+
"RequestHeaders": {
90+
"x-ms-client-request-id": [
91+
"bd4865c4-ce75-40a8-b82c-5c2ebbf95e48"
92+
],
93+
"User-Agent": [
94+
"FxVersion/4.700.22.36202",
95+
"OSName/Windows",
96+
"OSVersion/Microsoft.Windows.10.0.22000",
97+
"Microsoft.Azure.Management.Compute.ComputeManagementClient/57.0.0"
98+
]
99+
},
100+
"RequestBody": "",
101+
"ResponseHeaders": {
102+
"Cache-Control": [
103+
"no-cache"
104+
],
105+
"Pragma": [
106+
"no-cache"
107+
],
108+
"x-ms-ratelimit-remaining-resource": [
109+
"Microsoft.Compute/GetOperation3Min;49996,Microsoft.Compute/GetOperation30Min;399996"
110+
],
111+
"Strict-Transport-Security": [
112+
"max-age=31536000; includeSubDomains"
113+
],
114+
"x-ms-served-by": [
115+
"f11d738a-f4d5-4518-b51f-678877a2640b_132648252790131682"
116+
],
117+
"x-ms-request-id": [
118+
"69d10e48-dad5-44c5-89f8-d38d99e18194"
119+
],
120+
"Server": [
121+
"Microsoft-HTTPAPI/2.0",
122+
"Microsoft-HTTPAPI/2.0"
123+
],
124+
"x-ms-ratelimit-remaining-subscription-reads": [
125+
"11999"
126+
],
127+
"x-ms-correlation-request-id": [
128+
"2a602896-e587-4675-9541-1bf4d7958782"
129+
],
130+
"x-ms-routing-request-id": [
131+
"CENTRALUS:20220909T193815Z:2a602896-e587-4675-9541-1bf4d7958782"
132+
],
133+
"X-Content-Type-Options": [
134+
"nosniff"
135+
],
136+
"Date": [
137+
"Fri, 09 Sep 2022 19:38:15 GMT"
138+
],
139+
"Content-Length": [
140+
"994"
141+
],
142+
"Content-Type": [
143+
"application/json; charset=utf-8"
144+
],
145+
"Expires": [
146+
"-1"
147+
]
148+
},
149+
"ResponseBody": "{\r\n \"startTime\": \"2022-09-09T15:37:45.5986394-04:00\",\r\n \"endTime\": \"2022-09-09T15:37:45.6768383-04:00\",\r\n \"status\": \"Succeeded\",\r\n \"properties\": {\r\n \"output\": {\r\n \"name\": \"desadsanddescon1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.Compute/diskEncryptionSets/desadsanddescon1\",\r\n \"type\": \"Microsoft.Compute/diskEncryptionSets\",\r\n \"location\": \"northeurope\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"6138c972-5063-4dc3-9da5-682d1490bf9f\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\r\n },\r\n \"properties\": {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.KeyVault/vaults/kvadsanddescon1\"\r\n },\r\n \"keyUrl\": \"https://kvadsanddescon1.vault.azure.net/keys/kadsanddescon1/a07a0b98ac3c4139b627190699e0804e\"\r\n },\r\n \"encryptionType\": \"ConfidentialVmEncryptedWithCustomerKey\",\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n }\r\n },\r\n \"name\": \"492d4803-a084-4ca3-aebd-bdd8f3eaf7cf\"\r\n}",
150+
"StatusCode": 200
151+
},
152+
{
153+
"RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.Compute/diskEncryptionSets/desadsanddescon1?api-version=2022-03-02",
154+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2Fkc2FuZGRlc2NvbjEvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL2Rpc2tFbmNyeXB0aW9uU2V0cy9kZXNhZHNhbmRkZXNjb24xP2FwaS12ZXJzaW9uPTIwMjItMDMtMDI=",
155+
"RequestMethod": "GET",
156+
"RequestHeaders": {
157+
"x-ms-client-request-id": [
158+
"bd4865c4-ce75-40a8-b82c-5c2ebbf95e48"
159+
],
160+
"User-Agent": [
161+
"FxVersion/4.700.22.36202",
162+
"OSName/Windows",
163+
"OSVersion/Microsoft.Windows.10.0.22000",
164+
"Microsoft.Azure.Management.Compute.ComputeManagementClient/57.0.0"
165+
]
166+
},
167+
"RequestBody": "",
168+
"ResponseHeaders": {
169+
"Cache-Control": [
170+
"no-cache"
171+
],
172+
"Pragma": [
173+
"no-cache"
174+
],
175+
"x-ms-ratelimit-remaining-resource": [
176+
"Microsoft.Compute/LowCostGet3Min;14993,Microsoft.Compute/LowCostGet30Min;119981"
177+
],
178+
"Strict-Transport-Security": [
179+
"max-age=31536000; includeSubDomains"
180+
],
181+
"x-ms-served-by": [
182+
"f11d738a-f4d5-4518-b51f-678877a2640b_132648252790131682"
183+
],
184+
"x-ms-request-id": [
185+
"f9e11aac-e39e-4dcf-b81f-55507388a133"
186+
],
187+
"Server": [
188+
"Microsoft-HTTPAPI/2.0",
189+
"Microsoft-HTTPAPI/2.0"
190+
],
191+
"x-ms-ratelimit-remaining-subscription-reads": [
192+
"11998"
193+
],
194+
"x-ms-correlation-request-id": [
195+
"fd51facb-39b4-4362-a80c-5f3af3f97a6b"
196+
],
197+
"x-ms-routing-request-id": [
198+
"CENTRALUS:20220909T193816Z:fd51facb-39b4-4362-a80c-5f3af3f97a6b"
199+
],
200+
"X-Content-Type-Options": [
201+
"nosniff"
202+
],
203+
"Date": [
204+
"Fri, 09 Sep 2022 19:38:15 GMT"
205+
],
206+
"Content-Length": [
207+
"894"
208+
],
209+
"Content-Type": [
210+
"application/json; charset=utf-8"
211+
],
212+
"Expires": [
213+
"-1"
214+
]
215+
},
216+
"ResponseBody": "{\r\n \"name\": \"desadsanddescon1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.Compute/diskEncryptionSets/desadsanddescon1\",\r\n \"type\": \"Microsoft.Compute/diskEncryptionSets\",\r\n \"location\": \"northeurope\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"6138c972-5063-4dc3-9da5-682d1490bf9f\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\r\n },\r\n \"properties\": {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.KeyVault/vaults/kvadsanddescon1\"\r\n },\r\n \"keyUrl\": \"https://kvadsanddescon1.vault.azure.net/keys/kadsanddescon1/a07a0b98ac3c4139b627190699e0804e\"\r\n },\r\n \"encryptionType\": \"ConfidentialVmEncryptedWithCustomerKey\",\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}",
217+
"StatusCode": 200
218+
},
219+
{
220+
"RequestUri": "/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.Compute/diskEncryptionSets/desadsanddescon1?api-version=2022-03-02",
221+
"EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvZTM3NTEwZDctMzNiNi00Njc2LTg4NmYtZWU3NWJjYzAxODcxL3Jlc291cmNlR3JvdXBzL2Fkc2FuZGRlc2NvbjEvcHJvdmlkZXJzL01pY3Jvc29mdC5Db21wdXRlL2Rpc2tFbmNyeXB0aW9uU2V0cy9kZXNhZHNhbmRkZXNjb24xP2FwaS12ZXJzaW9uPTIwMjItMDMtMDI=",
222+
"RequestMethod": "GET",
223+
"RequestHeaders": {
224+
"x-ms-client-request-id": [
225+
"ca0ee892-4320-471d-9d7f-c927a232375b"
226+
],
227+
"Accept-Language": [
228+
"en-US"
229+
],
230+
"User-Agent": [
231+
"FxVersion/4.700.22.36202",
232+
"OSName/Windows",
233+
"OSVersion/Microsoft.Windows.10.0.22000",
234+
"Microsoft.Azure.Management.Compute.ComputeManagementClient/57.0.0"
235+
]
236+
},
237+
"RequestBody": "",
238+
"ResponseHeaders": {
239+
"Cache-Control": [
240+
"no-cache"
241+
],
242+
"Pragma": [
243+
"no-cache"
244+
],
245+
"x-ms-ratelimit-remaining-resource": [
246+
"Microsoft.Compute/LowCostGet3Min;14992,Microsoft.Compute/LowCostGet30Min;119980"
247+
],
248+
"Strict-Transport-Security": [
249+
"max-age=31536000; includeSubDomains"
250+
],
251+
"x-ms-served-by": [
252+
"f11d738a-f4d5-4518-b51f-678877a2640b_132648252790131682"
253+
],
254+
"x-ms-request-id": [
255+
"d663660c-0321-4d59-aa55-919416d60bbf"
256+
],
257+
"Server": [
258+
"Microsoft-HTTPAPI/2.0",
259+
"Microsoft-HTTPAPI/2.0"
260+
],
261+
"x-ms-ratelimit-remaining-subscription-reads": [
262+
"11999"
263+
],
264+
"x-ms-correlation-request-id": [
265+
"ceab977f-b477-4514-89df-beb3d5496d9c"
266+
],
267+
"x-ms-routing-request-id": [
268+
"CENTRALUS:20220909T193818Z:ceab977f-b477-4514-89df-beb3d5496d9c"
269+
],
270+
"X-Content-Type-Options": [
271+
"nosniff"
272+
],
273+
"Date": [
274+
"Fri, 09 Sep 2022 19:38:18 GMT"
275+
],
276+
"Content-Length": [
277+
"894"
278+
],
279+
"Content-Type": [
280+
"application/json; charset=utf-8"
281+
],
282+
"Expires": [
283+
"-1"
284+
]
285+
},
286+
"ResponseBody": "{\r\n \"name\": \"desadsanddescon1\",\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.Compute/diskEncryptionSets/desadsanddescon1\",\r\n \"type\": \"Microsoft.Compute/diskEncryptionSets\",\r\n \"location\": \"northeurope\",\r\n \"identity\": {\r\n \"type\": \"SystemAssigned\",\r\n \"principalId\": \"6138c972-5063-4dc3-9da5-682d1490bf9f\",\r\n \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\r\n },\r\n \"properties\": {\r\n \"activeKey\": {\r\n \"sourceVault\": {\r\n \"id\": \"/subscriptions/e37510d7-33b6-4676-886f-ee75bcc01871/resourceGroups/adsanddescon1/providers/Microsoft.KeyVault/vaults/kvadsanddescon1\"\r\n },\r\n \"keyUrl\": \"https://kvadsanddescon1.vault.azure.net/keys/kadsanddescon1/a07a0b98ac3c4139b627190699e0804e\"\r\n },\r\n \"encryptionType\": \"ConfidentialVmEncryptedWithCustomerKey\",\r\n \"provisioningState\": \"Succeeded\"\r\n }\r\n}",
287+
"StatusCode": 200
288+
}
289+
],
290+
"Names": {},
291+
"Variables": {
292+
"SubscriptionId": "e37510d7-33b6-4676-886f-ee75bcc01871"
293+
}
294+
}

0 commit comments

Comments
 (0)