Fix key vault secret name mismatch#1310
Merged
jasontaylordev merged 1 commit intojasontaylordev:mainfrom Jul 25, 2025
Merged
Conversation
The key vault secret name for the database user and admin user in the main.parameters.json did not match the secret name in the [flexibleserver|sqlserver].bicep files. The latter files are the one that save the passwords into the secrets, and because the secrets never get saved by the name that the main.parameters.json specifies, it kept generatign new passwords on each deployment. This resulted in the connection string getting invalid starting with the second deployment.
Owner
|
Thank you 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey guys,
I've been having the issue that after each infrastructure deployment I had a new key vault secret version for the database passwords and connections string.
It sounds implausible that nobody else encountered this issue till now, so it can be that I'm missing something, but anyways, here's what I think is happening.
The key vault secret name for the database user and admin user in the main.parameters.json did not match the secret name in the [flexibleserver|sqlserver].bicep files.
The latter files are the ones that set the key vault secret names for the passwords. The main.parameters.json was referring to these secrets under different names, by which it never found a secret so it kept generating new passwords on each deployment.
e.g.:
The password doesn't get updated in the DB once it's been created, but the secret did get updated to a new version, resulting in the connection string getting invalid starting with the second deployment.