Skip to content

Commit 88e70bd

Browse files
authored
Merge pull request Azure#11349 from gkostal/attestation-s167-bug-fixes-2
[Az.Attestation] Improved error messages and updated examples in documentation
2 parents 68a2c33 + 6545aab commit 88e70bd

15 files changed

+154
-63
lines changed

src/Attestation/Attestation/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121

2222
## Upcoming Release
23+
* Improved error messages for server response codes 400 and 401
24+
* Improved example code included in documentation files
2325
* Added three additional required assemblies to Az.Attestation.psd1
2426

2527
## Version 0.1.5

src/Attestation/Attestation/Commands/GetAzureAttestationPolicy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public class GetAzureAttestationPolicy : AttestationDataServiceCmdletBase
6868
/// </summary>
6969
[Parameter(Mandatory = true,
7070
HelpMessage =
71-
"Specifies a type of Trusted Execution Environment. We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VSMEnclave."
71+
"Specifies a type of Trusted Execution Environment. We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VBSEnclave."
7272
)]
73-
[PSArgumentCompleter("SgxEnclave", "OpenEnclave", "CyResComponent", "VSMEnclave")]
73+
[PSArgumentCompleter("SgxEnclave", "OpenEnclave", "CyResComponent", "VBSEnclave")]
7474
[ValidateNotNullOrEmpty]
7575
public string Tee { get; set; }
7676

src/Attestation/Attestation/Commands/ResetAzureAttestationPolicy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ public class ResetAzureAttestationPolicy : AttestationDataServiceCmdletBase
6969
/// </summary>
7070
[Parameter(Mandatory = true,
7171
HelpMessage =
72-
"Specifies a type of Trusted Execution Environment. We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VSMEnclave."
72+
"Specifies a type of Trusted Execution Environment. We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VBSEnclave."
7373
)]
74-
[PSArgumentCompleter("SgxEnclave", "OpenEnclave", "CyResComponent", "VSMEnclave")]
74+
[PSArgumentCompleter("SgxEnclave", "OpenEnclave", "CyResComponent", "VBSEnclave")]
7575
[ValidateNotNullOrEmpty]
7676
public string Tee { get; set; }
7777

src/Attestation/Attestation/Commands/SetAzureAttestationPolicy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ public class SetAzureAttestationPolicy : AttestationDataServiceCmdletBase
6868
/// </summary>
6969
[Parameter(Mandatory = true,
7070
HelpMessage =
71-
"Specifies a type of Trusted Execution Environment. We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VSMEnclave."
71+
"Specifies a type of Trusted Execution Environment. We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VBSEnclave."
7272
)]
73-
[PSArgumentCompleter("SgxEnclave", "OpenEnclave", "CyResComponent", "VSMEnclave")]
73+
[PSArgumentCompleter("SgxEnclave", "OpenEnclave", "CyResComponent", "VBSEnclave")]
7474
[ValidateNotNullOrEmpty]
7575
public string Tee { get; set; }
7676

src/Attestation/Attestation/Models/AttestationDataServiceClient.cs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
using Microsoft.Azure.Management.Internal.Resources.Utilities.Models;
2424
using Microsoft.Rest;
2525
using Microsoft.Rest.Azure;
26+
using Newtonsoft.Json;
2627

2728
namespace Microsoft.Azure.Commands.Attestation.Models
2829
{
@@ -163,10 +164,28 @@ private string GetDataPlaneUri(string name, string resourceGroupName, bool refre
163164

164165
private void ThrowOn4xxErrors(AzureOperationResponse<object> result)
165166
{
166-
if (result.Response.StatusCode == HttpStatusCode.BadRequest)
167-
throw new ArgumentException($"Operation returns BadRequest");
168-
if (result.Response.StatusCode == HttpStatusCode.Unauthorized)
169-
throw new ArgumentException("Operation is unauthorized");
167+
int statusCode = (int) result.Response.StatusCode;
168+
169+
if (statusCode >= 400 && statusCode <= 499)
170+
{
171+
var responseBody = result.Response.Content.ReadAsStringAsync().Result;
172+
var errorDetails = $"Operation returned HTTP Status Code {statusCode}";
173+
174+
// Include response body as either parsed ServerError or string
175+
if (!string.IsNullOrEmpty(responseBody))
176+
{
177+
try
178+
{
179+
var error = JsonConvert.DeserializeObject<ServerError>(responseBody).Error;
180+
errorDetails += $"\n\rCode: {error.Code}\n\rMessage: {error.Message}\n\r";
181+
}
182+
catch (Exception)
183+
{
184+
errorDetails += $"\n\rResponse Body: {responseBody}\n\r";
185+
}
186+
}
187+
throw new RestException(errorDetails);
188+
}
170189
}
171190

172191
/// <summary>
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// ----------------------------------------------------------------------------------
2+
//
3+
// Copyright Microsoft Corporation
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
// Unless required by applicable law or agreed to in writing, software
9+
// distributed under the License is distributed on an "AS IS" BASIS,
10+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
// See the License for the specific language governing permissions and
12+
// limitations under the License.
13+
// ----------------------------------------------------------------------------------
14+
15+
using System;
16+
using System.Collections.Generic;
17+
using System.Text;
18+
using Microsoft.Rest;
19+
using Newtonsoft.Json;
20+
21+
namespace Microsoft.Azure.Commands.Attestation.Models
22+
{
23+
public class ServerError
24+
{
25+
public class ErrorImpl
26+
{
27+
[JsonProperty(PropertyName = "code")]
28+
public string Code { get; set; }
29+
30+
[JsonProperty(PropertyName = "message")]
31+
public string Message { get; set; }
32+
}
33+
34+
[JsonProperty(PropertyName = "error")]
35+
public ErrorImpl Error;
36+
}
37+
}

src/Attestation/Attestation/help/Add-AzAttestationPolicySigner.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ The Add-AzAttestationPolicySigner cmdlet adds a trusted policy signer for a tena
3232
### Example 1
3333
```powershell
3434
PS C:\> $trustedSigner = Get-Content -Path .\trusted.signer.txt
35-
PS C:\> Add-AzAttestationPolicySigner -Name "myservice" -ResourceGroupName "myrg" -Signer $trustedSigner
35+
PS C:\> Add-AzAttestationPolicySigner -Name pshtest -ResourceGroupName psh-test-rg -Signer $trustedSigner
3636
```
3737

38-
Adds a new trusted signer for the tenant named "myservice".
38+
Add a trusted signer for the Atteestation Provider named *pshtest*.
3939

4040
## PARAMETERS
4141

src/Attestation/Attestation/help/Get-AzAttestation.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,23 @@ The Get-AzAttestation cmdlet gets information about the attestation in a subscri
3030

3131
### Example 1
3232
```powershell
33-
PS C:\> Get-AzAttestation -Name "example" -ResourceGroupName "rg1"
34-
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/rg1/providers/Microsoft.Attestation/attestationProviders/example
35-
Name : example
36-
Type : Microsoft.Attestation/attestationProviders
37-
Status : Ready
38-
AttesUri : https://example.us.attest.azure.net
39-
ResoureGroupName : rg1
40-
SubscriptionId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
33+
PS C:\> Get-AzAttestation -Name pshtest -ResourceGroupName psh-test-rg
34+
Id : subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/psh-test-rg/providers/Microsoft.Attestation/attestationProviders/pshtest
35+
Location : East US
36+
ResourceGroupName : psh-test-rg
37+
Name : pshtest
38+
Status : Ready
39+
TrustModel : AAD
40+
AttestUri : https://pshtest.us.attest.azure.net
41+
Tags : {Production, Example}
42+
TagsTable :
43+
Name Value
44+
========== =====
45+
Production False
46+
Example True
4147
```
4248

43-
Get Attestation "example" in Resource Group "rg1".
49+
Get Attestation Provider *pshtest* in Resource Group *psh-test-rg*.
4450

4551
## PARAMETERS
4652

src/Attestation/Attestation/help/Get-AzAttestationPolicy.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,11 @@ The Get-AzAttestationPolicy cmdlet gets the policy from a tenant in Azure Attest
3131

3232
### Example 1
3333
```powershell
34-
PS C:\> Get-AzAttestationPolicy -Name "example" -Tee "SgxEnclave"
34+
PS C:\> Get-AzAttestationPolicy -Name pshtest -ResourceGroupName psh-test-rg -Tee SgxEnclave
35+
eyJhbGciOiJub25lIn0.eyJBdHRlc3RhdGlvblBvbGljeSI6ICJkbVZ5YzJsdmJqMGdNUzR3TzJGMWRHaHZjbWw2WVhScGIyNXlkV3hsYzN0ak9sdDBlWEJsUFQwaUpHbHpMV1JsWW5WbloyRmliR1VpWFNBOVBpQndaWEp0YVhRb0tUdDlPMmx6YzNWaGJtTmxjblZzWlhON1l6cGJkSGx3WlQwOUlpUnBjeTFrWldKMVoyZGhZbXhsSWwwZ1BUNGdhWE56ZFdVb2RIbHdaVDBpYVhNdFpHVmlkV2RuWVdKc1pTSXNJSFpoYkhWbFBXTXVkbUZzZFdVcE8yTTZXM1I1Y0dVOVBTSWtjMmQ0TFcxeWMybG5ibVZ5SWwwZ1BUNGdhWE56ZFdVb2RIbHdaVDBpYzJkNExXMXljMmxuYm1WeUlpd2dkbUZzZFdVOVl5NTJZV3gxWlNrN1l6cGJkSGx3WlQwOUlpUnpaM2d0YlhKbGJtTnNZWFpsSWwwZ1BUNGdhWE56ZFdVb2RIbHdaVDBpYzJkNExXMXlaVzVqYkdGMlpTSXNJSFpoYkhWbFBXTXVkbUZzZFdVcE8yTTZXM1I1Y0dVOVBTSWtjSEp2WkhWamRDMXBaQ0pkSUQwLUlHbHpjM1ZsS0hSNWNHVTlJbkJ5YjJSMVkzUXRhV1FpTENCMllXeDFaVDFqTG5aaGJIVmxLVHRqT2x0MGVYQmxQVDBpSkhOMmJpSmRJRDAtSUdsemMzVmxLSFI1Y0dVOUluTjJiaUlzSUhaaGJIVmxQV011ZG1Gc2RXVXBPMk02VzNSNWNHVTlQU0lrZEdWbElsMGdQVDRnYVhOemRXVW9kSGx3WlQwaWRHVmxJaXdnZG1Gc2RXVTlZeTUyWVd4MVpTazdmVHMifQ.
3536
```
3637

37-
Gets the policy for tenant "example" in Tee "SgxEnclave".
38+
Gets the policy for Attestation Provider *pshtest* for Tee type *SgxEnclave*.
3839

3940
## PARAMETERS
4041

@@ -101,7 +102,7 @@ Accept wildcard characters: False
101102
102103
### -Tee
103104
Specifies a type of Trusted Execution Environment.
104-
We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VSMEnclave.
105+
We support four types of environment: SgxEnclave, OpenEnclave, CyResComponent and VBSEnclave.
105106
106107
```yaml
107108
Type: System.String

src/Attestation/Attestation/help/Get-AzAttestationPolicySigners.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,33 @@ The Get-AzAttestationPolicySigners cmdlet gets the trusted policy signers from a
3131

3232
### Example 1
3333
```powershell
34-
PS C:\> Get-AzAttestationPolicySigners -Name "myservice" -ResourceGroupName "myrg"
34+
PS C:\> Get-AzAttestationPolicySigners -Name pshtest -ResourceGroupName psh-test-rg
35+
CertificateCount : 0
36+
Jwt : eyJhbGciOiAiUlMyNTYiLCAiamt1IjogImh0dHBzOi8vcHNodGVzdC51cy5hdHRlc3QuYXp1cmUubmV0L2NlcnRzIiwgImtpZCI6ICJrdlB4aUJlemk4RGJsQVY0WE5nNG5wVjlocE5WTnRqS0NQTlZZUjRuRVJzPSIsICJ0eXAiOiAiSldUIn0.eyJhYXMtcG9saWN5Q2VydGlmaWNhdGVzIjogeyJrZXlzIjogW119LCAiZXhwIjogMTU4NDM5NDgxOSwgImlhdCI6IDE1ODQzOTEyMTksICJpc3MiOiAiaHR0cHM6Ly9wc2h0ZXN0LnVzLmF0dGVzdC5henVyZS5uZXQiLCAibmJmIjogMTU4NDM5MTIxOX0.hXDejUE2Tfbnvy0RN4ONyxtg2NTEmHKz7wOJIY2YhF43MUJQYgh7TREE3BAMl93mQIO9px2HNvo_MSzNhDRmCMvZt6tUdC8Gw1xK40w2nqngvfmTONOcKskSXUVc1Igk2C47cuCQjB1W8t2qdCrwpR4UTEGdidyGlb7NFkAaFMOK119H1c0DQ7LSpY0bqodrVDW1DNa0LOFLxL3DwxqkRF-itk
37+
duZJn9aqlkrgIPPSE_kdNUUURjpx3F6eCEONsdtu8zfj76v7Yb6Oyf70rh8EOyVdEu2wwmfg9ASZnooANwo7C6o68ESpfvi6DHPTyBsD0rgysVsNYtkS0tuXNj3A
38+
Algorithm : RS256
39+
JKU : https://pshtest.us.attest.azure.net/certs
40+
Certificates : {}
3541
```
3642

37-
Gets the trusted policy signers for the tenant named "myservice".
43+
Gets the trusted policy signers for the Attestation Provider *pshtest* in Resource Group *psh-test-rg*. Note that there are no trusted signers for this Attestation Provider.
44+
45+
### Example 2
46+
```powershell
47+
PS C:\> Get-AzAttestationPolicySigners -Name pshtest2 -ResourceGroupName psh-test-rg
48+
CertificateCount : 1
49+
Jwt : eyJhbGciOiAiUlMyNTYiLCAiamt1IjogImh0dHBzOi8vcHNodGVzdDIudXMuYXR0ZXN0LmF6dXJlLm5ldC9jZXJ0cyIsICJraWQiOiAiL09KMXJ0U0hkbFJnR1VqMGVuTEl5bDhLeHQ3NHZYdmJLTW9VbmFZMlNJRT0iLCAidHlwIjogIkpXVCJ9.eyJhYXMtcG9saWN5Q2VydGlmaWNhdGVzIjogeyJrZXlzIjogW3siYWxnIjogIlJTMjU2IiwgImt0eSI6ICJSU0EiLCAidXNlIjogInNpZyIsICJ4NWMiOiBbIk1JSURMRENDQWhTZ0F3SUJBZ0lJYStGTE1oT1ZkMFF3RFFZSktvWklodmNOQVFFTEJRQXdGekVWTUJNR0ExVUVBd3dNVFdGaFZHVnpkRU5sY25ReE1DQVhEVEl3TURNd016QXdNREF3TUZvWUR6SXdOekF3TXpBek1EQXdNREF3V2pBWE1SVXdFd1lEVlFRRERBeE5ZV0ZVWlhOMFEyVnlkREV3Z2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJQkR3QXdnZ0VLQW9JQkFRQ3BidzRLeHJhME05OE9RNUMzQkk3Uk9BS2k4dnlRNTF5eWJoUi9saTJDd1Y4WkVJZmVZSEJMMFM5UC9naVQ2VTlZRkNtNEw3c2hGTm5kYTBJcG5zeTZSaFhCUnRYampZdVR1SlcxTk01SVh0OVFJMEtkUUNQbG5VVlNnb2UzdW9pQ0l6S25HU1Nka0MrU25nblVveDFsVnVRNEpLSmtLUXBubTFCekgzTGNzUEFnQUJwYTloVnlieG9XUHU4c2tEek1TSVFZVzMxemVYVkxZdlprZmxoTWttNFZLby9DUWpYNXJWTFNXeVZWa1YrOUhDQjlVQk1HMExiNmhldWZTQTVKTE5mR2taY0kwNHBHRmFqVzZnVUJkcmJnM2R4V0s5VzdKUVZYT05maEJ6NkE2bWM1a0wxRUtLNWhIc2dnekdYeEdLWmhwWU5JSDNiek52eTNrUUFQQWdNQkFBR2plakI0TUVZR0ExVWRJd1EvTUQyQUZIWnBTaFI4UUlRMGFzZy9Yb1NwR2hNOURGN25vUnVrR1RBWE1SVXdFd1lEVlFRRERBeE5ZV0ZVWlhOMFEyVnlkREdDQ0d2aFN6SVRsWGRFTUIwR0ExVWREZ1FXQkJSMmFVb1VmRUNFTkdySVAxNkVxUm9UUFF4ZTV6QVBCZ05WSFJNQkFmOEVCVEFEQVFIL01BMEdDU3FHU0liM0RRRUJDd1VBQTRJQkFRQVFpWXpFeUtVbDlkSWVUVGZnTVpBWEo0V0NFZXpFN2FRcHd2QnU5Rkk0MXN4L1pzbEV2RVFvTDVWNTZTQVhQZCtTOWdlZnVJNjFuZ056OTl5RTlrZGgrOWxmVTJVTU1tdXFCdVFWaWI5RzBKakllYVNHM1J2OGVyRXNGMUUrbXhjbzRtVGVEdUdLUklmN1dHNnNYZjZ5b2N1U0FVaEV2emM5NzZTSUNJLzQxclZEVkg5bnFJdS9LUnZleHpWcFJqZ1EzWlVnMTMydmVnb2djNjc1UndreTJHckxrZDBJN015bGcwZVIyamd1ZndLcTVBbnZ1YTlzRFJyUUpLUCtqclpmcWpiOEpoZ2VsUEtLVXl4S1JIS1Z6QUxzQ3JHTkRQS0ozVDlsWUhmZmFuWE9JeEpnTDExcDNBMmVMUWtWN3BMdEpUenhrb1lDZFZKdTNmbDZJNWVsIl19XX0sICJleHAiOiAxNTg0Mzk1MTE5LCAiaWF0IjogMTU4NDM5MTUxOSwgImlzcyI6ICJodHRwczovL3BzaHRlc3QyLnVzLmF0dGVzdC5henVyZS5uZXQiLCAibmJmIjogMTU4NDM5MTUxOX0Irkd3eNG7jD-fJThxBKURjjSlsfbRgOnOvN_nI8ukH-VvpaYIKGgk74iuefWhPYQJr--mAUT2IaEqcBGXvRV6K4oDUXUHn7iCNL1aIWzQ4udTrFVChNTUjEH4x1tmyDLC04SBeoi_yP5R0Bfijb51qnKwSU6ppuKTTletpzFztib2MN_RUQidHjuaeivMECJPRu5Bit2DbLRObokMRRY-rftcxPf7rLr1mK_4WUbRjIKT_ic03qWcqY0lakwC3MdFV9xQsvCH7-sizgJShSIOIS9pHrRp6YIEyG8LoF6Kj9aL-imNTUZ2IjwxtDJOmnhXh56pYjzQNpW_bzQlOeNaA
50+
Algorithm : RS256
51+
JKU : https://pshtest2.us.attest.azure.net/certs
52+
Certificates : {{
53+
"alg": "RS256",
54+
"kty": "RSA",
55+
"use": "sig",
56+
"x5c": ["MIIDLDCCAhSgAwIBAgIIa+FLMhOVd0QwDQYJKoZIhvcNAQELBQAwFzEVMBMGA1UEAwwMTWFhVGVzdENlcnQxMCAXDTIwMDMwMzAwMDAwMFoYDzIwNzAwMzAzMDAwMDAwWjAXMRUwEwYDVQQDDAxNYWFUZXN0Q2VydDEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpbw4Kxra0M98OQ5C3BI7ROAKi8vyQ51yybhR/li2CwV8ZEIfeYHBL0S9P/giT6U9YFCm4L7shFNnda0Ipnsy6RhXBRtXjjYuTuJW1NM5IXt9QI0KdQCPlnUVSgoe3uoiCIzKnGSSdkC+SngnUox1lVuQ4JKJkKQpnm1BzH3LcsPAgABpa9hVybxoWPu8skDzMSIQYW31zeXVLYvZkflhMkm4VKo/CQjX5rVLSWyVVkV+9HCB9UBMG0Lb6heufSA5JLNfGkZcI04pGFajW6gUBdrbg3dxWK9W7JQVXONfhBz6A6mc5kL1EKK5hHsggzGXxGKZhpYNIH3bzNvy3kQAPAgMBAAGjejB4MEYGA1UdIwQ/MD2AFHZpShR8QIQ0asg/XoSpGhM9DF7noRukGTAXMRUwEwYDVQQDDAxNYWFUZXN0Q2VydDGCCGvhSzITlXdEMB0GA1UdDgQWBBR2aUoUfECENGrIP16EqRoTPQxe5zAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAQiYzEyKUl9dIeTTfgMZAXJ4WCEezE7aQpwvBu9FI41sx/ZslEvEQoL5V56SAXPd+S9gefuI61ngNz99yE9kdh+9lfU2UMMmuqBuQVib9G0JjIeaSG3Rv8erEsF1E+mxco4mTeDuGKRIf7WG6sXf6yocuSAUhEvzc976SICI/41rVDVH9nqIu/KRvexzVpRjgQ3ZUg132vegogc675Rwky2GrLkd0I7Mylg0eR2jgufwKq5Anvua9sDRrQJKP+jrZfqjb8JhgelPKKUyxKRHKVzALsCrGNDPKJ3T9lYHffanXOIxJgL11p3A2eLQkV7pLtJTzxkoYCdVJu3fl6I5el"]
57+
}}
58+
```
59+
60+
Gets the trusted policy signers for the Attestation Provider *pshtest2* in Resource Group *psh-test-rg*. Note that there is one trusted signer for this Attestation Provider.
3861

3962
## PARAMETERS
4063

src/Attestation/Attestation/help/New-AzAttestation.md

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,39 @@ The New-AzAttestation cmdlet creates an attestation in the specified resource gr
2525

2626
### Example 1
2727
```powershell
28-
PS C:\> New-AzAttestation -Name "example" -ResourceGroupName "rg1"
29-
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/rg1/providers/Microsoft.Attestation/attestationProviders/example
30-
Name : example
31-
Type : Microsoft.Attestation/attestationProviders
32-
Status : Ready
33-
AttesUri : https://example.us.attest.azure.net
34-
ResoureGroupName : rg1
35-
SubscriptionId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
28+
PS C:\> New-AzAttestation -Name pshtest4 -ResourceGroupName psh-test-rg -Location "East US" -Tags @{Test="true";CreationYear="2020"}
29+
Id : subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/psh-test-rg/providers/Microsoft.Attestation/attestationProviders/pshtest4
30+
Location : East US
31+
ResourceGroupName : psh-test-rg
32+
Name : pshtest4
33+
Status : Ready
34+
TrustModel : AAD
35+
AttestUri : https://pshtest4.us.attest.azure.net
36+
Tags : {CreationYear, Test}
37+
TagsTable :
38+
Name Value
39+
============ =====
40+
CreationYear 2020
41+
Test true
3642
```
3743

44+
Create a new instance of an Attestation Provider named *pshtest4* with a couple tags and using AAD trust for mastering TEE policy.
45+
3846
### Example 2
3947
```powershell
40-
PS C:\> New-AzAttestation -Name "example" -ResourceGroupName "rg1" -AttestationPolicy "SgxDisableDebugMode"
41-
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/rg1/providers/Microsoft.Attestation/attestationProviders/example
42-
Name : example
43-
Type : Microsoft.Attestation/attestationProviders
44-
Status : Ready
45-
AttesUri : https://example.us.attest.azure.net
46-
ResoureGroupName : rg1
47-
SubscriptionId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
48+
PS C:\> New-AzAttestation -Name pshtest3 -ResourceGroupName psh-test-rg -Location "East US" -PolicySignersCertificateFile .\cert1.pem
49+
Id : subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/psh-test-rg/providers/Microsoft.Attestation/attestationProviders/pshtest3
50+
Location : East US
51+
ResourceGroupName : psh-test-rg
52+
Name : pshtest3
53+
Status : Ready
54+
TrustModel : Isolated
55+
AttestUri : https://pshtest3.us.attest.azure.net
56+
Tags :
57+
TagsTable :
4858
```
4959

50-
### Example 3
51-
```powershell
52-
PS C:\> New-AzAttestation -Name "example" -ResourceGroupName "rg1" -PolicySigningCertificateFile "c:\test\certs.pem"
53-
Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx/resourceGroups/rg1/providers/Microsoft.Attestation/attestationProviders/example
54-
Name : example
55-
Type : Microsoft.Attestation/attestationProviders
56-
Status : Ready
57-
AttesUri : https://example.us.attest.azure.net
58-
ResoureGroupName : rg1
59-
SubscriptionId : xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxx
60-
```
60+
Create a new instance of an Attestation Provider named *pshtest3*` that uses Isoladed trust for mastering TEE policy via specifying a set of trusted signing keys via a PEM file.
6161

6262
## PARAMETERS
6363

@@ -192,6 +192,8 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
192192
193193
### System.String
194194
195+
### System.Collections.Hashtable
196+
195197
## OUTPUTS
196198
197199
### Microsoft.Azure.Commands.Attestation.Models.PSAttestation

src/Attestation/Attestation/help/Remove-AzAttestation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ The Remove-AzAttestation cmdlet deletes the specified attestation.
3737

3838
### Example 1
3939
```powershell
40-
PS C:\> Remove-AzAttestation -Name "example" -ResourceGroupName "rg1"
40+
PS C:\> Remove-AzAttestation -Name pshtest3 -ResourceGroupName psh-test-rg
4141
```
4242

43-
Delete Attestation "example" from current Subscription and Resource Group "rg1".
43+
Delete the Attestation Provider named *pshtest3* in the resource group named *psh-test-rg* from the current subscription.
4444

4545
## PARAMETERS
4646

0 commit comments

Comments
 (0)