This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class ServiceExtensions | |
{ | |
public static IServiceCollection AddTypedHttpClient(this IServiceCollection service, IConfiguration configuration) | |
{ | |
service.Configure<HttpClientConfiguration>( | |
configuration.GetSection(nameof(HttpClientConfiguration))); | |
var provider = service.BuildServiceProvider(); | |
var httpConfiguration = provider.GetService<IOptions<HttpClientConfiguration>>().Value; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
configurationBuilder.AddAzureKeyVault(new AzureKeyVaultConfigurationOptions | |
{ | |
Vault = configuration["KeyVaultUrl"], | |
ReloadInterval = TimeSpan.FromMinutes(10), | |
Client = new KeyVaultClient(new KeyVaultClient.AuthenticationCallback( | |
new AzureServiceTokenProvider().KeyVaultTokenCallback)) | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.Azure.KeyVault.Models; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.Configuration.AzureKeyVault; | |
namespace Demo.Azure.KeyVault | |
{ | |
public class PrefixKeyVaultSecretManager : IKeyVaultSecretManager | |
{ | |
private readonly string _prefix; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[FunctionName("SbusQueueTriggerFunction")] | |
public async Task RunAsync( | |
[ServiceBusTrigger("%QueueName%", Connection = "SbusConnectionString")] | |
Message message, | |
MessageReceiver messageReceiver, | |
ILogger log) | |
{ | |
// ... | |
// dead-letter the msg |
NewerOlder