我目前正在编写这里编写的教程,用于创建和部署队列触发的azure函数。
在第2步的“创建函数”部分中,我不清楚我们应该为“连接”字符串添加什么。 我假设它是您希望函数使用的存储帐户名称。
我遇到的另一个问题是,当我在本地系统上设置并测试Azure功能时,我将其部署到Azure,并且我没有选择要使用的当前存储帐户。
我相信当我将函数发布到azure时,这会导致创建一个新的存储帐户。 这非常令人沮丧,因为这意味着我必须使用具有丑陋GUID的存储帐户,并且还必须创建新的存储队列。 我在某处错过了一步吗?
I am currently running through the tutorial written here for creating and deploying a queue triggered azure function.
In the "Create a function" section on step 2, it isn't clear to me what we are supposed to put for the "Connection" string. I am assuming it is the storage account name that you want the function to use.
The other issue I am having is when I have set up and tested the Azure Function on my local system, I go to deploy it to Azure and I am not presented with an option to select a current storage account to use.
I believe this is causing a new storage account to be created when I publish the function to azure. This is very frustrating because that means I have to use a storage account with an ugly GUID and also have to create a new storage queue. Am I missing a step somewhere?
最满意答案
我们应该为“连接”字符串添加什么。
使用Azure Functions模板创建新项目时,将获得一个空的C#项目,其中包含以下文件: host.json和local.settings.json ,您可以指定连接字符串到其他Azure服务(例如Azure存储)在local.settings.json文件中。 然后,您可以在创建函数时使用连接字符串名称设置“ 连接”选项的值。
local.settings.json
{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName={your_account_name};AccountKey={your_account_key};EndpointSuffix=core.windows.net", "AzureWebJobsDashboard": "DefaultEndpointsProtocol=https;AccountName={your_account_name};AccountKey={your_account_key};EndpointSuffix=core.windows.net" } }使用AzureWebJobsStorage创建一个函数并设置Connection选项的值
我没有看到选择要使用的当前存储帐户的选项。
我正在使用Visual Studio 2017版本15.3.0预览7.1和Azure功能和Web作业工具版本15.0.30923.0,它提供了选择存储帐户的选项。 如果可能,请升级Visual Studio并更新Azure功能和Web作业工具。
what we are supposed to put for the "Connection" string.
When you create a new project using the Azure Functions template, you get an empty C# project that contains the following files: host.json and local.settings.json, and you can specify connection strings to other Azure services (such as Azure storage) in local.settings.json file. And then you can set value of Connection option with connection string name when you create a function.
local.settings.json
{ "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName={your_account_name};AccountKey={your_account_key};EndpointSuffix=core.windows.net", "AzureWebJobsDashboard": "DefaultEndpointsProtocol=https;AccountName={your_account_name};AccountKey={your_account_key};EndpointSuffix=core.windows.net" } }Create a function and set value of Connection option with AzureWebJobsStorage
I am not presented with an option to select a current storage account to use.
I’m using Visual studio 2017 Version 15.3.0 preview 7.1 and Azure Functions and Web Jobs Tools Version 15.0.30923.0, It provides the option to choose Storage account. If possible, please upgrade your Visual Studio and update your Azure Functions and Web Jobs Tools.
更多推荐
发布评论