page_type | languages | products | urlFragment | |||
---|---|---|---|---|---|---|
sample |
|
|
keyvault-secrets-samples |
This document explains samples and how to use them.
Key concepts are explained in detail here.
Getting started explained in detail here.
Following section document various examples.
- HelloWorld.java - and HelloWorldAsync.java - Contains samples for following scenarios:
- Create a Secret
- Retrieve a Secret
- Update a Secret
- Delete a Secret
- ListOperations.java and ListOperationsAsync.java - Contains samples for following scenarios:
- Create a Secret
- List Secrets
- Create new version of existing secret.
- List versions of an existing secret.
- BackupAndRestoreOperations.java and BackupAndRestoreOperationsAsync.java - Contains samples for following scenarios:
- Create a Secret
- Backup a Secret -- Write it to a file.
- Delete a secret
- Restore a secret
- ManagingDeletedSecrets.java and ManagingDeletedSecretsAsync.java - Contains samples for following scenarios:
- Create a Secret
- Delete a secret
- List deleted secrets
- Recover a deleted secret
- Purge Deleted secret
Key Vault clients raise exceptions. For example, if you try to retrieve a secret after it is deleted a 404
error is returned, indicating resource not found. In the following snippet, the error is handled gracefully by catching the exception and displaying additional information about the error.
try {
SecretClient.getSecret("deletedSecret")
} catch (ResourceNotFoundException e) {
System.out.println(e.getMessage());
}
Start using KeyVault Java SDK in your solutions. Our SDK details could be found at SDK README.
For more extensive documentation on Azure Key Vault, see the API reference documentation.
This project welcomes contributions and suggestions. Find more contributing details here.