After changing the signature of the function ConfigureServices to be asynchronous (originally it was just a void synchronous function and the application worked perfectly fine), I get the following error:
Unable to find the required services. Please add all the required services by calling
IServiceCollection.AddAuthorizationinside the call toConfigureServices(...)in the application startup code.
Below is the code of my ConfigureServices function.
// This method gets called by the runtime. Use this method to add services to the container.
public async Task ConfigureServices(IServiceCollection services)
{
services.AddRazorPages();
// Create the necessary Cosmos DB infrastructure
await CreateDatabaseAsync();
await CreateContainerAsync();
}
ConfigureServices is automatically called at runtime.