Simple application that adds text content to a clip repository and lists secret repository.
- Create an Azure Key Vault.
- Create an Azure Blob Storage.
- Create a service principal
- Create a client secret for that service principal
- Set the environment variable
AZURE_CLIENT_SECRETwith the application secret. - Set the environment variable
AZURE_CLIENT_IDwith the "Application (client) id". - Set the environment variable
AZURE_TENANT_IDwith the "Directory (tenant) id".
- Update application.properties with service principal information.
- Update
keyvault.endpointwith the Key Vault endpoint.
- Update
- Grant your service principal permissions to your Key Vault.
- Go to your Key Vault.
- Under "Settings", select "Access policies".
- Select "Add Access Policy".
- Find your service principal and add permissions for them to Get, and List secrets.
- Grant your service principal permissions to your Blob Storage.
- Go to your Blob Storage.
- Select "Access control (IAM)".
- Select "Add" -> "Add role assignment".
- Fill in the following fields:
- Role: "Storage Blob Data Owner"
- Assign access to: "Azure AD user, group, or service principal"
- Find your service principal.
- Open application-production.properties.
- Update the following properties:
storage.container-namestorage.endpoint
- Update the following properties:
- Open application-oldsdk.properties
- Update the following properties:
storage.container-namestorage.account-namestorage.access-key- This can be found under "Settings" -> "Access keys" in your storage account.
- Update the following properties:
- Create a container in your Azure Blob storage that matches
storage.container-name.
- Start the application by executing:
mvn spring-boot:run - Open a web browser, go to http://localhost:8080
Switch between profiles by updating spring.profiles.active property in application.properties.
| Profile | Description |
|---|---|
dev |
Uses in memory clip and secret repository |
production |
Uses Azure Blob Storage and Key Vault through the new client libraries |
oldsdk |
Uses Azure Blob Storage and Key Vault through the old client libraries |