Skip to content

SeanFeldman/ServiceBus.AttachmentPlugin.KeyVaultProvider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Icon

This is a KeyVault provider for ServiceBus.AttachmentPlugin add-in

License

develop

Issues

Nuget package

NuGet Status

Available here http://nuget.org/packages/ServiceBus.AttachmentPlugin.KeyVaultProvider

To Install from the Nuget Package Manager Console

PM> Install-Package ServiceBus.AttachmentPlugin.KeyVaultProvider

Examples

Convert body into attachment, no matter how big it is

Configuration and registration

var provider = new KeyVaultProvider("client-id", "client-secret", "secret-identifier");
var configuration = new AzureStorageAttachmentConfiguration(provider);

var queueClient = new QueueClient(...);
queueClient.RegisterAzureStorageAttachmentPlugin(configuration);

await queueClient.SendAsync(new Message(Encoding.UTF8.GetBytes("payload to transfer via storage account")));

var messageReceiver = new MessageReceiver(...);
messageReceiver.RegisterAzureStorageAttachmentPlugin(configuration);

var message = await messageReceiver.ReceiveAsync();

Using Managed Service Identity (MSI)

var provider = new KeyVaultProvider("secret-identifier");
var configuration = new AzureStorageAttachmentConfiguration(provider);

var queueClient = new QueueClient(...);
queueClient.RegisterAzureStorageAttachmentPlugin(configuration);

await queueClient.SendAsync(new Message(Encoding.UTF8.GetBytes("payload to transfer via storage account")));

var messageReceiver = new MessageReceiver(...);
messageReceiver.RegisterAzureStorageAttachmentPlugin(configuration);

var message = await messageReceiver.ReceiveAsync();

Note: for local testing with MSI, an environment variable named AzureServicesAuthConnectionString has to be defined with a value RunAs=App;AppId=<application-id>;TenantId=<directory-id>;AppKey=<client-secret>.

Icon

Created by Gregor Cresnar from the Noun Project

About

KeyVault provider for ServiceBus.AttachmentPlugin

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages