Update secret handling and configuration in Bicep files #6
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.
Update secret handling and configuration in Bicep files
Updated BeyondTrustCredentialClient to retrieve secret name from
KEYVAULT_SECRET environment variable and handle deserialization
errors. Added keyvaultSecretName property to functionAppConfig
type in main.bicep and updated related modules to use this
property. Updated functionConfig parameter to include
keyvaultSecretName. Added keyvaultSecretName parameter to
functionapp.bicep and secretName parameter to
vault-role-assignment.bicep. Changed roleAssignment scope to
specific secret within Key Vault.
PR Classification
Code enhancement to improve configuration management and error handling.
PR Summary
Updated the
BeyondTrustCredentialClient
to use an environment variable for the secret name and improved error handling. Modified Bicep files to support the new configuration.BeyondTrustCredentialClient.cs
: Read secret name fromKEYVAULT_SECRET
environment variable and added null-coalescing operator for deserialization.main.bicep
: AddedkeyvaultSecretName
property tofunctionAppConfig
and updatedfunctionappModule
andvaultSecretUserRoleAssignment
modules.functionapp.bicep
: AddedkeyvaultSecretName
parameter and setKEYVAULT_SECRET
environment variable.vault-role-assignment.bicep
: AddedsecretName
parameter, changedroleAssignment
scope, and addedkeyVaultSecret
resource.