-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Readme and sample tweaks #14801
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
christothes
merged 4 commits into
Azure:master
from
christothes:users/chriss/KvAdminReadmeFixups
Sep 2, 2020
Merged
Readme and sample tweaks #14801
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a4a8d20
Readme and sample tweaks
christothes 959c3b8
Update sdk/keyvault/Azure.Security.KeyVault.Administration/readme.md
christothes 487190c
Update sdk/keyvault/Azure.Security.KeyVault.Administration/readme.md
christothes 876269f
Update sdk/keyvault/Azure.Security.KeyVault.Administration/readme.md
christothes File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...ault/Azure.Security.KeyVault.Administration/samples/Sample2_SelectiveRestore.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Performing a full key restore | ||
|
|
||
| Using the `KeyVaultBackupClient`, you can restore a single key from backup by key name. The data source for a | ||
| selective key restore is a storage blob accessed using Shared Access Signature authentication. | ||
| For more details on creating a SAS token using the `BlobServiceClient`, see the | ||
| [Azure Storage Blobs client README](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/README.md) | ||
| and the [authentication samples](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/storage/Azure.Storage.Blobs/samples/Sample02_Auth.cs). | ||
| Alternatively, it is possible to [generate a SAS token in Storage Explorer](https://docs.microsoft.com/en-us/azure/vs-azure-tools-storage-manage-with-storage-explorer?tabs=windows#generate-a-shared-access-signature-in-storage-explorer) | ||
|
|
||
| ```C# Snippet:SelectiveRestoreAsync | ||
| // Get the folder name from the backupBlobUri returned from a previous BackupOperation. | ||
| string[] uriSegments = backupBlobUri.Segments; | ||
| string folderName = uriSegments[uriSegments.Length - 1]; | ||
| string keyName = <key name to restore>; | ||
|
|
||
| // Start the restore for a specific key that was previously backed up. | ||
| RestoreOperation restoreOperation = await Client.StartSelectiveRestoreAsync(keyName, builder.Uri, sasToken, folderName); | ||
|
|
||
| // Wait for completion of the RestoreOperation. | ||
| Response restoreResult = await restoreOperation.WaitForCompletionAsync(); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be H4s under
KeyVaultBackupClientsince they are related only to that? Don't really care much either way - just putting it out there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good idea, but since there are so few, I decided to keep each major type at the same level.