0
votes

I created an Azure Function with a Azure Service Bus Topic trigger in Visual Studio 2019. The local.settings.json and the publish profile are given below.

The Azure Function works in my laptop. I sent a message to the Azure Service Bus and the function is executed and see the log in the Azure Function CLI Shell.

local.settings.json

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=false",
    "FUNCTIONS_WORKER_RUNTIME": "dotnet",
    "mysubscription": "Endpoint=..."
  }
}

Publish Profile

enter image description here

I published the Function to Azure. The Function is running. But nothing happens after I send a message to the Azure Service Bus*.

My questions are:

  1. I see error for Run Time Version Error. What configuration I need to change to make it working.
  2. I want to see the output of log.LogInformation($"C# ServiceBus topic trigger function processed message: {mySbMsg}");. Which menu item that I need to use to see the logs like I see in the shell in my laptop?

Azure Portal

enter image description here

enter image description here

enter image description here

UPDATE 6/25/2020

I added a new application setting mysubscription in the Azure Portal for that Function App. I can see the Function Execution count increasing. I also integrated the Application Insights and can see the log from the application. Here is the sample:

enter image description here

1
Azure Functions has different versions. i.e. v1, v2, v3. Cross check you VS Azure FunctionApp (This option is available while you are creating new function in VS) Version and Azure Function App Version.DSA

1 Answers

1
votes

The content of your local settings are not published to Azure Functions Settings, you need to setup them using your release pipeline / powershell script / manually.

Seems to me that if you just create a setting with the key "mysubscription" and the value "Endpoint..." it should work.