Skip to content

Commit

Permalink
Change 'secret.keys' to 'secret-keys' (Azure#15359)
Browse files Browse the repository at this point in the history
* Change 'secret.keys' to 'secret-keys'

Co-authored-by: Rujun Chen <[email protected]>
  • Loading branch information
Rujun Chen and rujche authored Sep 21, 2020
1 parent 2518416 commit 4df82e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ az keyvault set-policy --name <your_keyvault_name> \
```
> **IMPORTANT**
>
> The property `azure.keyvault.secret.keys` specifies which exact secrets the application will load from Key Vault. If this property is not set, which means the application will have to **list** all the secrets in Key Vault, you have to grant both **LIST** and **GET** secret permission to the service principal. Otherwise, only **GET** secret permission is needed.
> The property `azure.keyvault.secret-keys` specifies which exact secrets the application will load from Key Vault. If this property is not set, which means the application will have to **list** all the secrets in Key Vault, you have to grant both **LIST** and **GET** secret permission to the service principal. Otherwise, only **GET** secret permission is needed.
Save the displayed Key Vault uri for later use.

Expand Down Expand Up @@ -64,7 +64,7 @@ azure.keyvault.client-key=put-your-azure-client-key-here
azure.keyvault.tenant-id=put-your-azure-tenant-id-here

# Uncomment following property if you want to specify the secrets to load from Key Vault
# azure.keyvault.secret.keys=yourSecretPropertyName1,yourSecretPropertyName2
# azure.keyvault.secret-keys=yourSecretPropertyName1,yourSecretPropertyName2
```


Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# Release History

## 3.0.0-beta.1 (Unreleased)
### Breaking Changes
- Change configure item from `azure.keyvault.secret.keys` to `azure.keyvault.secret-keys`
- Change configure item from `azure.keyvault.allow.telemetry` to `azure.keyvault.allow-telemetry`


## 2.3.5 (2020-09-14)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ in the Spring Boot documentation.

## Examples
### Custom settings
To use the custom configuration, open `application.properties` file and add below properties to specify your Azure Key Vault url, Azure service principal client id and client key. `azure.keyvault.enabled` is used to turn on/off Azure Key Vault Secret property source, default is true. `azure.keyvault.token-acquiring-timeout-seconds` is used to specify the timeout in seconds when acquiring token from Azure AAD. Default value is 60 seconds. This property is optional. `azure.keyvault.refresh-interval` is the period for PropertySource to refresh secret keys, its value is 1800000(ms) by default. This property is optional. `azure.keyvault.secret.keys` is a property to indicate that if application using specific secret keys, if this property is set, application will only load the keys in the property and won't load all the keys from keyvault, that means if you want to update your secrets, you need to restart the application rather than only add secrets in the keyvault.
To use the custom configuration, open `application.properties` file and add below properties to specify your Azure Key Vault url, Azure service principal client id and client key. `azure.keyvault.enabled` is used to turn on/off Azure Key Vault Secret property source, default is true. `azure.keyvault.token-acquiring-timeout-seconds` is used to specify the timeout in seconds when acquiring token from Azure AAD. Default value is 60 seconds. This property is optional. `azure.keyvault.refresh-interval` is the period for PropertySource to refresh secret keys, its value is 1800000(ms) by default. This property is optional. `azure.keyvault.secret-keys` is a property to indicate that if application using specific secret keys, if this property is set, application will only load the keys in the property and won't load all the keys from keyvault, that means if you want to update your secrets, you need to restart the application rather than only add secrets in the keyvault.
```
azure.keyvault.enabled=true
azure.keyvault.uri=put-your-azure-keyvault-uri-here
Expand All @@ -59,7 +59,7 @@ azure.keyvault.client-key=put-your-azure-client-key-here
azure.keyvault.tenant-id=put-your-azure-tenant-id-here
azure.keyvault.token-acquire-timeout-seconds=60
azure.keyvault.refresh-interval=1800000
azure.keyvault.secret.keys=key1,key2,key3
azure.keyvault.secret-keys=key1,key2,key3
```

### Use MSI / Managed identities
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void keyVaultAsPropertySourceWithSpecificKeys() {
app.property("azure.keyvault.client-key", CLIENT_SECRET_ACCESS.clientSecret());
app.property("azure.keyvault.tenant-id", CLIENT_SECRET_ACCESS.tenantId());

app.property("azure.keyvault.secret.keys", KEY_VAULT_SECRET_NAME + " , azure-cosmosdb-key");
app.property("azure.keyvault.secret-keys", KEY_VAULT_SECRET_NAME + " , azure-cosmosdb-key");
LOGGER.info("====" + KEY_VAULT_SECRET_NAME + " , azure-cosmosdb-key");

app.start();
Expand Down

0 comments on commit 4df82e4

Please sign in to comment.