| services | key-vault |
|---|---|
| platforms | java |
| author | tiffanyachen |
This sample repo demonstrates how to create an Azure Key Vault with access limited to specific IP ranges and Azure Virtual Networks.
- Java 1.7+
- An Azure Service Principal, through Azure CLI, PowerShell or Azure Portal.
-
If not installed, install Java.
-
Clone the repository.
git clone https://github.com/Azure-Samples/key-vault-java-authentication.git
-
Create an Azure service principal, using Azure CLI, PowerShell or Azure Portal. Note that if you wish to authenticate with the certificate authenticator the certificate should be saved locally.
-
Add the following values to the pom.xml in the configurations for the exec-maven-plugin.
<systemProperties>
<systemProperty>
<key>AZURE_TENANT_ID</key>
<value>{AZURE_TENANT_ID}</value>
</systemProperty>
<systemProperty>
<key>AZURE_CLIENT_ID</key>
<value>{AZURE_CLIENT_ID}</value>
</systemProperty>
<systemProperty>
<key>AZURE_CLIENT_SECRET</key>
<value>{AZURE_CLIENT_SECRET}</value>
</systemProperty>
<systemProperty>
<key>AZURE_OBJECT_ID</key>
<value>{AZURE_OBJECT_ID}</value>
</systemProperty>
<systemProperties>
AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET must be set for general Azure authentication.
- Run
mvn clean compile exec:javafor a full run-through.