Azure Key Vault Secret Samples client library for Java
This document explains samples and how to use them.
Key concepts
Key concepts are explained in detail here.
Getting started
Getting started explained in detail here.
Examples
Following section document various examples.
Hello World Samples
- HelloWorld.java - and HelloWorldAsync.java - Contains samples for following scenarios:
- Create a Secret
- Retrieve a Secret
- Update a Secret
- Delete a Secret
List Operations Samples
- 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.
Backup And Restore Operations Samples
- 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
Managing Deleted Secrets Samples:
- 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
Troubleshooting
General
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());
}
Next steps
Start using KeyVault Java SDK in your solutions. Our SDK details could be found at SDK README.
Additional Documentation
For more extensive documentation on Azure Key Vault, see the API reference documentation.
Contributing
This project welcomes contributions and suggestions. Find more contributing details here.