Hi I upgrading my workers to dotnet 8 and isolated worker.
I have removed the Microsoft.Azure.Webjobs.Extensions.ServiceBus dependency as suggested in document https://learn.microsoft.com/en-us/azure/azure-functions/migrate-dotnet-to-isolated-model?tabs=net8#programcs-file.
But now I am getting error in Program.cs file for line:
services.Configure<ServiceBusOptions>(options =>
{
options.AutoCompleteMessages = false;
});
with ServiceBusOptions that it cannot be found. What can I do here?
here is my hostbuilder function,
var host = new HostBuilder()
.ConfigureFunctionsWebApplication()
.ConfigureServices(services => {
services.AddApplicationInsightsTelemetryWorkerService();
services.ConfigureFunctionsApplicationInsights();
services.Configure<ServiceBusOptions>(options =>
{
options.AutoCompleteMessages = false;
});
})
.Build();
host.Run();
I am not sure what to do, since I am new to .NET and Azure, any help would be appreciated.
Thanks for the article @Andrew B.
I got the same error when I tried to implement the same in my environment.
Refer the MSDOC for the example code.
To set
AutoCompleteMessages= false, add the attribute in the function code as shown below:Program.cs:
Sending message:
Console Response: