Skip to content

Commit c1fe373

Browse files
DecSmith42Copilot
andauthored
Update DecSm.Atom.Module.AzureKeyVault/AzureKeySecretsProvider.cs
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fcac419 commit c1fe373

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

DecSm.Atom.Module.AzureKeyVault/AzureKeySecretsProvider.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,9 @@ private TokenCredential GetCredential(IAzureKeyVault definition)
189189

190190
var port = buildDefinition.AccessParam(nameof(IAzureKeyVault.AzureVaultAuthPort)) switch
191191
{
192-
string portString => int.Parse(portString),
192+
string portString => int.TryParse(portString, out var parsedPort)
193+
? parsedPort
194+
: throw new InvalidOperationException($"Invalid port value for AzureVaultAuthPort: '{portString}'. Please provide a valid integer."),
193195
int portInt => portInt,
194196
_ => 0,
195197
};

0 commit comments

Comments
 (0)