0

I have two Azure Functions in same project, one is TimeTrigger and another is QueueTrigger. When I run my project, TimeTrigger function working properly but QueueTrigger function throwing error as

Microsoft.Azure.WebJobs.Host: Error indexing method 'MyFunction'. Microsoft.WindowsAzure.Storage: Settings must be of the form "name=value".

I feel like this issue is because I have two different Azure Functions in same project (TimeTrigger and QueueTrigger) but not sure I'm still looking into that issue.

Note: Please ignore my issue if this is not related to having QueueTrigger and TimeTrigger azure functions in same project, my actual question in below.

I know that we can have different types of azure functions in same project, like TimeTrigger and HttpTrigger. Now my question is may I have all types of azure functions in same project? or are there any rules for having different types of azure function in same project?

My project in .NetCore 2.1, Azure Function Core Tools 2.7 and Function Runtime Version 2.0.

Shri
  • 351
  • 3
  • 16
  • 1
    Can you try this out - https://github.com/MicrosoftDocs/azure-docs/issues/30469#issuecomment-489053545? – Silly John Jul 15 '19 at 09:25
  • @SillyJohn I have already tried that solution but it's not working. – Shri Jul 15 '19 at 10:52
  • This issue is resolved, it was my mistake, was using QueueTrigger (Storage Queue) function instead of ServiceBusTrigger (ServiceBus Queue) function. – Shri Jul 15 '19 at 11:48

1 Answers1

0

As Silly said, when you run the QueueTrigger function on local, you need to set AzureWebJobsStorage application setting which is really not needed for just a TimeTrigger function.

"IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet"
  }

When you publish your function to azure, the local.settings.json will not upload, and you would go to Configuration to set AzureWebJobsStorage in it.

Now my question is may I have all types of azure functions in same project?

Yes, you can add all types of function in same project while you have some limitations you need to refer to.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30
  • Thanks, I had already tried that solution to resolve that issue, but it's not working, but I got answer for my question. – Shri Jul 15 '19 at 10:56