@Neil Thompson Thanks for reaching out. You would need Microsoft.Extensions.Configuration.UserSecrets package for your requirement. Not the official microsoft document but I found this third party article which can help you with the steps and source code. Let me know if it helps you.
.NET5 Azure Function (isolated) User Secrets not working
Can anyone point me to an example of how to use user secrets with a .NET5 isolated function
Given the new project out-of-the-box example, how do I get PortalStorage:ConnectionString
from user secrets?
note: If I run dotnet user-secrets list
from the app root I can see the secrets ok
c#
public static void Run([QueueTrigger("queue-auditlog-dev", Connection = "PortalStorage:ConnectionString")] string myQueueItem,
FunctionContext context)
Running the function
Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.Function1'. Microsoft.Azure.WebJobs.Extensions.Storage: Storage account connection string 'AzureWebJobsPortalStorage:ConnectionString' does not exist. Make sure that it is a defined App Setting.
I have no idea where it gets AzureWebJobsPortalStorage
from when the Connection is passed PortalStorage:ConnectionString
.
Azure Functions
1 answer
Sort by: Most helpful
-
MayankBargali-MSFT 70,941 Reputation points Moderator
2022-04-07T12:30:06.603+00:00