Azure / Azure/azure-functions-host

If reading secrets from BlobStorage fails, log the reason.

Open
#6,890 0 comments 0 reactions 1 assignee Assigned to @alrod View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.