Azure / Azure/azure-functions-host
If reading secrets from BlobStorage fails, log the reason.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 36
Description
Currently, if we failed to read secrets from blog storage, we do not log reason. Fixing this will help better diagnose future failures.
https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script.WebHost/Security/KeyManagement/BlobStorageSecretsRepository.cs#L93
```
public override async Task ReadAsync(ScriptSecretsType type, string functionName)
{
string secretsContent = null;
string blobPath = GetSecretsBlobPath(type, functionName);
try
{
CloudBlockBlob secretBlob = Container.GetBlockBlobReference(blobPath);
if (await secretBlob.ExistsAsync())
{
secretsContent = await secretBlob.DownloadTextAsync();
}
}
catch (Exception e)
{
LogErrorMessage("read");
throw e;
}
return string.IsNullOrEmpty(secretsContent) ? null : ScriptSecretSerializer.DeserializeSecrets(type, secretsContent);
}
````
Contributor guide
Assessment
This issue has not been assessed yet.