Skip to content

Commit 8ff9df2

Browse files
Ensure fatal exceptions do not cause key regeneration (#8777)
Co-authored-by: Fabio Cavalcante <[email protected]>
1 parent d29c39f commit 8ff9df2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/WebJobs.Script.WebHost/Security/KeyManagement/SecretManager.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public async virtual Task<HostSecretsInfo> GetHostSecretsAsync()
106106
// so we read the secrets running them through the appropriate readers
107107
hostSecrets = ReadHostSecrets(hostSecrets);
108108
}
109-
catch (CryptographicException ex)
109+
catch (CryptographicException ex) when (!ex.InnerException.IsFatal())
110110
{
111111
string message = string.Format(Resources.TraceNonDecryptedHostSecretRefresh, ex);
112112
_logger.LogDebug(message);
@@ -175,7 +175,7 @@ public async virtual Task<IDictionary<string, string>> GetFunctionSecretsAsync(s
175175
// Read all secrets, which will run the keys through the appropriate readers
176176
secrets.Keys = secrets.Keys.Select(k => _keyValueConverterFactory.ReadKey(k)).ToList();
177177
}
178-
catch (CryptographicException ex)
178+
catch (CryptographicException ex) when (!ex.InnerException.IsFatal())
179179
{
180180
string message = string.Format(Resources.TraceNonDecryptedFunctionSecretRefresh, functionName, ex);
181181
_logger.LogDebug(message);

0 commit comments

Comments
 (0)