VMh
VMh

Reputation: 1350

How to configure the storage account for the table storage bindings of the functions in the API of an Azure Static Web App

I have an Azure Static Web App being developed within Visual Studio Code, using the Azure Extension. By following some Quick Start tutorials I was able to add the API portion (Node based) and a couple functions that are working fine locally. These functions use a storage account through bindings for table storage, therefore I configured AzureWebJobsStorage in local.settings.json file to point to an Azure Storage Account. Everything works properly locally.

The problem is when I try to access the app live. The API portion is not working. I have found it to be because of a System.InvalidOperationException in this method Microsoft.Azure.WebJobs.StorageAccountProvider.Get.

I realized that the settings you specify in local.settings.json are just for local development, but when I try to set in the Portal the App Setting for AzureWebJobsStorage I get an error saying that that particular setting is not allowed. I have read that the reason why that is happening is because that particular setting is managed by the Static Web Apps framework.

MY QUESTION IS:

How do I specify the storage account that the functions in the API of the Static Web App should connect to for table storage bindings?

Upvotes: 1

Views: 250

Answers (1)

VMh
VMh

Reputation: 1350

Since AzureWebJobsStorage is used internally by the framework and cannot be set as a setting, I decided to stop using it. Instead I used my custom setting for the connection and now I can set it in Azure.

Upvotes: 0

Related Questions