如何在Azure静态Web应用程序的API中配置函数的表存储绑定的存储帐户
我使用Azure扩展程序在Visual Studio代码中开发了一个Azure静态Web应用程序。通过遵循一些快速启动教程,我可以添加API部分(基于节点)和几个在本地工作正常的功能。这些功能通过绑定用于表存储使用存储帐户,因此我在local.settings.json文件中配置了Azurewebjobsstorage,以指向Azure存储帐户。一切都在本地正常工作。
问题是当我尝试实时访问该应用程序时。 API部分不起作用。我发现这是因为系统。在此方法中invalidoperationException microsoft.azure.webjobs.storageageaccountprovider.get。
我意识到您在local.settings.json中指定的设置仅用于本地开发,但是当我尝试在Azurewebjobsstorage的门户网站中设置应用程序设置时,我会发现一个错误,说不允许使用该特定设置。我已经读到发生这种情况的原因是因为该特定设置是由静态Web应用程序框架管理的。
我的问题是:
如何指定静态Web应用程序API中功能应连接到表存储绑定的存储帐户?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于框架内部使用AzureWebjobSstorage,无法将其设置为设置,因此我决定停止使用它。相反,我将自定义设置用于连接,现在可以将其设置为Azure。
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.