This is a KeyVault provider for ServiceBus.AttachmentPlugin add-in
Available here http://nuget.org/packages/ServiceBus.AttachmentPlugin.KeyVaultProvider
To Install from the Nuget Package Manager Console
PM> Install-Package ServiceBus.AttachmentPlugin.KeyVaultProvider
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>
.
Created by Gregor Cresnar from the Noun Project