I have an azure function that is running on a timer. I want to write the last time the function ran successfully to table storage in the same storage account the function is using.
Is it possible to get the connection string for a function’s storage account with c# and read/write to it?
2
Answers
Yes, You can get by going to configuration section of function app and in that select
AzureWebJobsStorage
.The above selected is the connection string.
Alternatively, Firstly, you need to identify the storage account connected and use below process:
Open that Storage Account and get connection like below:
You need to got to Access keys section and get the connection string.
Yes, there are so many C#, python and other language SDKs with which we can easily access storage accounts . (You can use Output Bindings and in C# you can give it in local settings)
Yes, follow these steps to get the connection string from your function app’s storage account
Then, use Table Storage as an output binding, according to the programming language you are using the process of adding the connection string may vary, but in most of the cases you will need to paste it at the configuration file.
For C#
and within local.settings.json define and paste the value at the app setting