-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ServiceBusQueueTrigger not working with azure-functions-cli #128
Comments
Hey @riyajahamedi , I think I got it. You need to add the connection string to you appsettings.json file. In your case, you should do:
Don't forget to also add an "AzureWebJobsStorage". |
@cemarte I have added connection string in appsetting.json already. After adding that also i'm facing a same problem. Error is not changed after adding AzureWebJobsServiceBus & AzureWebJobsStorage values as well |
@riyajahamedi Do you have encrypted=true in your settings file? |
I am having the same issue. I am using VS 2017 Preview with Azure Functions Cli 1.0.0-beta.97. I have the following in local.settings.json:
Then I have the standard method:
When I run it locally I get the following errors: [5/19/17 7:09:33 PM] Starting Host (HostId=-2101161280, Version=1.0.10955.0, ProcessId=10216, Debug=False, Attempt=0) No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. config.UseServiceBus(), config.UseTimers(), etc.). Any idea what I am doing wrong??? This is a new install and followed the example provided... https://blogs.msdn.microsoft.com/webdev/2017/05/10/azure-function-tools-for-visual-studio-2017/ Thanks, Chris |
@doylestowncoder You can't use a connection string directly in the attribute. Use "Connection" = "ConnectionStringKey", and specify the value of that key in local.settings.json. |
Missing value for AzureWebJobsStorage in local.settings.json. This is required for all triggers other than HTTP. You can run 'func azure functionapp fetch-app-settings ' or specify a connection string in local.settings.json. Can you share a sample local.settings.json |
@vimaljnelson In our team we incurred in this same issue. Actual structure of Our understanding is that your connection string key+value should end up within {
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "DefaultEndpointsProtocol=https;AccountName <CONN. STRING TO STORAGE ACCOUNT>",
"AzureWebJobsDashboard": "DefaultEndpointsProtocol=https;AccountName <CONN. STRING TO STORAGE ACCOUNT>",
"YourServiceBusConnectionKey": "Endpoint=sb:// <CONN. STRING TO SERVICE BUS>",
}
} and in code you have: [FunctionName("YourFunctionName")]
public static void Run(
[ServiceBusTrigger("your-queue-name", AccessRights.Manage, Connection = "YourServiceBusConnectionKey")]string myQueueItem,
TraceWriter log) Also, in Azure portal, make sure to add that connection string key+value within Application Settings in Function App configuration blade. |
This is an old thread but I wanted to note that using the vs 2019 wizard for creating a service bus topic triggered function automatically puts your connection string directly in the ServiceBusTrigger attribute. Your suggested fix still works but the product is still broken. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi,
I tried to run the ServiceBusQueueTrigger function (Javascript) using func run comment. But its giving the following error after putting "AzureWebJobsServiceBus" in appsettings.json.
Error indexing method 'Functions.ServiceBusQueue-JS'
Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.ServiceBusQueue-JS'. Microsoft.Azure.WebJobs.ServiceBus: Microsoft Azure WebJobs SDK ServiceBus connection string 'AzureWebJobsServiceBus' is missing or empty.
Could you please help me on this.
The text was updated successfully, but these errors were encountered: