This sample uses certificate based service principal authentication to work with Keyvaults.
Azure Stack sample for managing Keyvaults
- Create a Keyvault using cert based authentication - Create a secret inside the keyvault - Get the secret - Delete the Resource Group.
Running this Sample
To run this sample:
Clone the repository using the following command:
Create an Azure service principal and assign a role to access the subscription. For instructions on creating a service principal, see Use Azure PowerShell to create a service principal with a certificate.
Export the service principal certificate as a pfx file.
Set the following required environment variable values:
- AZURE_OBJECT_ID (To set access permissions for KeyVault. You can retrieve this value from the output during Service Principal Creation)
Change directory to Hybrid sample:
- cd Hybrid-KeyVault-Java-Manage-Secrets-Certificate-Based-Auth
Run the sample:
- mvn clean compile exec:java