Mostly just a link to this article containing best practices.

There’s some useful extension methods available from Microsoft.Extensions.Azure to make for easier dependency injection of the various Azure services.

public void ConfigureServices(IServiceCollection services)
{
	services.AddAzureClients(builder =>
	{
		// Add a KeyVault client
		builder.AddSecretClient(keyVaultUrl);

		// Add a storage account client
		builder.AddBlobServiceClient(storageUrl);

		// Use the environment credential by default
		builder.UseCredential(new EnvironmentCredential());
	});

	services.AddControllers();
}

There’s also some good examples available here.


Leave a Reply

Your email address will not be published. Required fields are marked *