Reputation: 65
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?
Upvotes: 1
Views: 1570
Reputation: 27793
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.
Upvotes: 6