[KeyVault] Add samples for new certificate SANs (IP/URI) and secret outContentType/previousVersion features#48699
[KeyVault] Add samples for new certificate SANs (IP/URI) and secret outContentType/previousVersion features#48699rohitsinghal4u wants to merge 2 commits intomainfrom
Conversation
…utContentType/previousVersion features
There was a problem hiding this comment.
Pull request overview
Adds/updates Java “HelloWorld” samples in the Key Vault Certificates and Secrets libraries to demonstrate newly supported service features introduced around the 2025-07-01 API version (SAN IP/URI and secret outContentType/previousVersion).
Changes:
- Certificates sample: extend Subject Alternative Names to include IP addresses and URIs.
- Secrets sample: add guidance for
outContentTypeformat conversion and show accessingSecretProperties.getPreviousVersion().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/keyvault/azure-security-keyvault-certificates/src/samples/java/com/azure/security/keyvault/certificates/HelloWorld.java | Updates certificate creation policy sample to include SAN IP addresses and URIs. |
| sdk/keyvault/azure-security-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/HelloWorld.java | Adds sample guidance for outContentType and previousVersion usage in secrets. |
| // For certificate-backed secrets, we can retrieve the secret value in a different format using outContentType. | ||
| // For example, to get the value in PEM format instead of the default PKCS#12 format: | ||
| // KeyVaultSecret pemSecret = secretClient.getSecret("MyCertSecret", null, "application/x-pem-file"); |
There was a problem hiding this comment.
The outContentType snippet uses a different secret name ("MyCertSecret") than the rest of the sample and is commented out, which makes it harder to follow when reading the sample top-to-bottom. Consider using a clearly named placeholder variable (e.g., CERT_SECRET_NAME) and explicitly noting that this call only works for certificate-backed (PFX) secrets; otherwise the service may reject the request.
...curity-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/HelloWorld.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Description
This PR adds sample code demonstrating new KeyVault features:
Certificates
Secrets
outContentTypeparameter for format conversion (PFX/PEM)previousVersionproperty on SecretPropertiesFiles Changed
sdk/keyvault/azure-security-keyvault-certificates/src/samples/java/com/azure/security/keyvault/certificates/HelloWorld.javasdk/keyvault/azure-security-keyvault-secrets/src/samples/java/com/azure/security/keyvault/secrets/HelloWorld.java