Skip to content

Commit

Permalink
Certs shared service: Secret nexus-ssl-password is currently in a del…
Browse files Browse the repository at this point in the history
…eted but recoverable state microsoft#4294
  • Loading branch information
jonnyry committed Feb 1, 2025
1 parent 7c88fe4 commit b8ebefa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ BUG FIXES:
* Fix VM actions where Workspace shared storage doesn't allow shared key access ([#4222](https://github.com/microsoft/AzureTRE/issues/4222))
* Fix public exposure in Guacamole service ([[#4199](https://github.com/microsoft/AzureTRE/issues/4199)])
* Fix Azure ML network tags to use name rather than ID ([[#4151](https://github.com/microsoft/AzureTRE/issues/4151)])
* Certs shared service: Secret nexus-ssl-password is currently in a deleted but recoverable state ([#4294](https://github.com/microsoft/AzureTRE/issues/4294)])

COMPONENTS:

Expand Down
9 changes: 8 additions & 1 deletion templates/shared_services/certs/scripts/letsencrypt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,15 @@ sid=$(az keyvault certificate import \
--password "${CERT_PASSWORD}" \
| jq -r '.sid')

# Recover deleted secret (if exists) to prevent error when saving in following step
password_name="${cert_name}-password"
if az keyvault secret show-deleted --vault-name "$keyvault_name" --name "$password_name" &>/dev/null; then
echo "Found deleted secret '$password_name'. Recovering..."
az keyvault secret recover --vault-name "$keyvault_name" --name "$password_name"
fi

echo "Saving certificate password to KV with key ${cert_name}-password"
az keyvault secret set --name "${cert_name}"-password \
az keyvault secret set --name "$password_name" \
--vault-name "${keyvault_name}" \
--value "${CERT_PASSWORD}"

Expand Down

0 comments on commit b8ebefa

Please sign in to comment.