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.


0 Comments

Leave a Reply

Avatar placeholder

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