I have a Java 11 Azure Function with a queue trigger that works as expected when deployed to Azure and properly pulls messages off of the defined service bus topic. However, running the same function locally does not work unless I rollback the version of the Azure Functions binding extensions. If I don't revert the version back, the function starts locally but never pulls messages off the service bus topic.
The variable is the host.json file in the project that defines the extension bundle version. For the function deployed to Azure, the following host.json file is used which is configured for the latest version of the extension bundle:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[3.3.0, 4.0.0)"
}
}
The version that works locally is this:
{
"version": "2.0",
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[2.*, 3.0.0)"
}
}
The Azure function itself doesn't do anything special. When setting a breakpoint in the function, it is never called if I don't revert the Extension Bundle version back to the 2/3 version.
public class QueueTrigger {
private DatabaseProvider database;
@FunctionName(Constants.FunctionNames.RUN_CHANGE_HISTORY_TRIGGER)
public void run(
@ServiceBusTopicTrigger(name = "msg",
topicName = "%SERVICE_BUS_TOPIC_NAME%",
subscriptionName = "%SERVICE_BUS_SUBSCRIPTION_NAME%",
connection = "ServiceBusConnection") String message,
final ExecutionContext context) {
Logger logger = context.getLogger();
try {
logger.log(Level.INFO, String.format("Queue Trigger START (%s)", message));
database = new CosmosDatabaseProvider(logger);
ChangeHistoryService service = new ChangeHistoryService(database, logger);
service.processChanges(message);
this.database.close();
logger.log(Level.INFO, "Queue Trigger DONE");
} catch (Exception ex) {
logger.log(Level.SEVERE, ex.getMessage());
throw new ServiceResponseException(ex.getMessage(), ex);
}
}
}
I have the Azure Function Core Tools v4.0.3971 (latest version) installed on my PC, as do the rest of my team members that all have this same issue.
What am I missing in my local environment that is preventing the latest version of the extension bundle from working?

