Azure / Azure/Azure-Functions

Azure function doesn't bind to table storage after I publish to portal

Open
#946 1 comment 0 reactions 1 assignee Claimed by @eamonoreilly View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

I have a simple Azure function that I created with the Visual Studio tooling that removes expired announcements. It works great locally but doesn't work after I publish it to Azure. I know have the right connection string to my storage account because if I update the key/value in **local.settings.json** it works fine. Example: "AzureWebJobsStorage": "my_storage_connection_string".
This is a timer function that removes records in my table storage once a day. Here is my method signature for the function as it is in VS (cron job I use here is for testing only):

` [FunctionName("RemoveExpiredAnnouncements")]
public static async Task Run([TimerTrigger("0 */1 * * * *")]TimerInfo myTimer,
[Table("DeaconAnnouncements", Connection = "AzureWebJobsStorage")]CloudTable inTable,
TraceWriter log)`

I click on publish and create a new profile. There I select the correct resource group and storage account in the drop downs. Also, I've opened 'Manage Application Settings' and verified that the key 'AzureWebJobsStorage' maps to the correct connection string. I publish it and verified that it is active and running. But it does not connect to my table storage in Azure. Also, the read-only function.json file does not have the bindings data for the storage account. There is nothing in the function mapping 'AzureWebJobsStorage' to the key/value in my function app settings.

My workaround was to create a new function and copy & paste the code directly into my Azure portal. I had to edit the signature, of course, and I added the binding data to the **function.json** file per Microsoft's documentation. That works like a champ.

I do have a free student Azure account. As far as I know, that shouldn't be an issue, but I don't know for sure.

I posted this in Microsoft's forum: [forum post](https://social.msdn.microsoft.com/Forums/azure/en-US/c3539d3f-12eb-4880-bd59-adde0c11d872/azure-function-doesnt-bind-to-table-storage-after-i-publish-to-portal?forum=AzureFunctions)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.