Skip to content

Update KeyVault documentation #6308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
May 30, 2018
Merged

Update KeyVault documentation #6308

merged 16 commits into from
May 30, 2018

Conversation

maddieclayton
Copy link
Contributor

@maddieclayton maddieclayton commented May 25, 2018

Description

#6215
#6034

Checklist

Copy link
Contributor

@RandalliLama RandalliLama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome. Thanks for doing this.

@@ -67,7 +67,7 @@ internal PSDeletedKeyVaultCertificate(DeletedCertificateBundle deletedCertificat

if (deletedCertificateBundle.Tags != null)
{
Tags = (Hashtable) deletedCertificateBundle.Tags;
Tags = (deletedCertificateBundle.Tags == null) ? null : deletedCertificateBundle.Tags.ConvertToHashtable();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the check for null necessary here? This code is already wrapped in a check for null.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right - reverted. It was the cast that was failing.

@@ -123,7 +123,7 @@ internal PSDeletedKeyVaultCertificate(DeletedCertificateBundle deletedCertificat

if (deletedCertificateBundle.Tags != null)
{
Tags = (Hashtable) deletedCertificateBundle.Tags;
Tags = (deletedCertificateBundle.Tags == null) ? null : deletedCertificateBundle.Tags.ConvertToHashtable();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check for null on this line is unnecessary.

```
PS C:\>Backup-AzureKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey'
```powershell
PS C:\Users\username\> Backup-AzureKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was the path changed from root of the drive to a users directory for this example, but not the others in this file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to demonstrate the the file created would be placed in the current directory, which I thought wasn't shown too well by just using the root. If you want me to revert this and just mention in the comment that the output file is put in the current directory, I can do that as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just curious. I don't have any objections.

PS C:\>Backup-AzureKeyVaultSecret -Secret $secret -OutputFile 'C:\Backup.blob'
```powershell
PS C:\> $secret = Get-AzureKeyVaultSecret -VaultName 'MyKeyVault' -Name 'MySecret'
PS C:\> Backup-AzureKeyVaultSecret -InputObject $secret -OutputFile 'C:\Backup.blob'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that Secret is just an alias for InputObject, but why is it better to use InputObject in the example. Isn't that going to be harder for the user to remember and grok? If this is necessary for some reason, are there alternatives such as swapping the alias with the proper name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change back to "Secret"

@@ -174,8 +178,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable

## INPUTS

### None
This cmdlet does not accept any input.
### System.String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maddieclayton shouldn't this be Microsoft.Azure.Commands.KeyVault.Models.PSKeyVault (from InputObject)?

@@ -230,11 +261,10 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## INPUTS

### None
This cmdlet does not accept any input.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maddieclayton any reason to remove this text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think it added more value than "None"

CancellationRequested : False
CertificateSigningRequest : MIICpjCCAY4CAQAwFjEUMBIGA1UEAxMLY29udG9zby5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC73w3VRBOlgJ5Od1PjDh+2ytngNZp+ZP4fkuX8K1Ti5LA6Ih7eWx1fgAN/iTb6l
5K6LvAIJvsTNVePMNxfSdaEIJ70Inm45wVU4A/kf+UxQWAYVMsBrLtDFWxnVhzf6n7RGYke6HLBj3j5ASb9g+olSs6eON25ibF0t+u6JC+sIR0LmVGar9Q0eZys1rdfzJBIKq+laOM7z2pJijb5ANqve9
i7rH5mnhQk4V8WsRstOhYR9jgLqSSxokDoeaBClIOidSBYqVc1yNv4ASe1UWUCR7ZK6OQXiecNWSWPmgWEyawu6AR9eb1YotCr2ScheMOCxlm3103luitxrd8A7kMjAgMBAAGgSzBJBgkqhkiG9w0BCQ4
xPDA6MA4GA1UdDwEB/wQEAwIFoDAdBgNVHSUEFjAUBggrBgEFBQcDAQYIKwYBBQUHAwIwCQYDVR0TBAIwADANBgkqhkiG9w0BAQsFAAOCAQEAIHhsDJV37PKi8hor5eQf7+Tct1preIvSwqV0NF6Uo7O6
YnC9Py7Wp7CHfKzuqeptUk2Tsu7B5dHB+o9Ypeeqw8fWhTN0GFGRKO7WjZQlDqL+lRNcjlFSaP022oIP0kmvVhBcmZqRQlALXccAaxEclFA/3y/aNj2gwWeKpH/pwAkZ39zMEzpQCaRfnQk7e3l4MV8cf
eC2HPYdRWkXxAeDcNPxBuVmKy49AzYvly+APNVDU3v66gxl3fIKrGRsKi2Cp/nO5rBxG2h8t+0Za4l/HJ7ZWR9wKbd/xg7JhdZZFVBxMHYzw8KQ0ys13x8HY+PXU92Y7yD3uC2Rcj+zbAf+Kg==
ErrorCode :
==
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maddieclayton is this line needed?

```

This command removes Patti Fuller as a certificate contact for the Contoso01 key vault.
This command removes Patti Fuller as a certificate contact for the Contoso01 key vault. If PassThru is specified, the cmdlet returns the list of remaining certificate contacts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@maddieclayton just making sure, but is the above output correct even though the user didn't provide PassThru?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, added -PassThru

PS C:\>Backup-AzureKeyVaultCertificate -Certificate $cert -OutputFile 'C:\Backup.blob' -Force
```powershell
PS C:\> $cert = Get-AzureKeyVaultCertificate -VaultName 'MyKeyVault' -Name 'MyCert'
PS C:\> Backup-AzureKeyVaultCertificate -InputObject $cert -OutputFile 'C:\Backup.blob' -Force
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should InputObject we changed back to Certificate here?

PS C:\>Backup-AzureKeyVaultKey -Key $key -OutputFile 'C:\Backup.blob' -Force
```powershell
PS C:\> $key = Get-AzureKeyVaultKey -VaultName 'MyKeyVault' -Name 'MyKey'
PS C:\> Backup-AzureKeyVaultKey -InputObject $key -OutputFile 'C:\Backup.blob' -Force
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change back to Key?

PS C:\>Backup-AzureKeyVaultManagedStorageAccount -StorageAccount $msak -OutputFile 'C:\Backup.blob' -Force
```powershell
PS C:\> $msak = Get-AzureKeyVaultManagedStorageAccount -VaultName 'MyKeyVault' -Name 'MyMSAK'
PS C:\> Backup-AzureKeyVaultManagedStorageAccount -InputObject $msak -OutputFile 'C:\Backup.blob' -Force
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change back to StorageAccount?

cormacpayne
cormacpayne previously approved these changes May 29, 2018
@cormacpayne cormacpayne removed their assignment May 29, 2018
@maddieclayton
Copy link
Contributor Author

maddieclayton commented May 29, 2018

@RandalliLama Addressed the three comments - if this is looking good to you, I will target it for the release going out on Tuesday morning.

@RandalliLama
Copy link
Contributor

:shipit:

@RandalliLama RandalliLama removed the request for review from schaabs May 30, 2018 00:27
@maddieclayton maddieclayton changed the base branch from preview to release-6.2.0 May 30, 2018 00:30
@maddieclayton maddieclayton merged commit bd1f44b into Azure:release-6.2.0 May 30, 2018
@maddieclayton maddieclayton deleted the kvdoc branch May 30, 2018 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants