Microsoft.CoreWCF.Azure.StorageQueues 1.0.0-beta.1

Prefix Reserved
This is a prerelease version of Microsoft.CoreWCF.Azure.StorageQueues.
dotnet add package Microsoft.CoreWCF.Azure.StorageQueues --version 1.0.0-beta.1
NuGet\Install-Package Microsoft.CoreWCF.Azure.StorageQueues -Version 1.0.0-beta.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version ofInstall-Package.
<PackageReference Include="Microsoft.CoreWCF.Azure.StorageQueues" Version="1.0.0-beta.1" />
For projects that supportPackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.CoreWCF.Azure.StorageQueues" Version="1.0.0-beta.1" />
Directory.Packages.props
<PackageReference Include="Microsoft.CoreWCF.Azure.StorageQueues" />
Project file
For projects that supportCentral Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Microsoft.CoreWCF.Azure.StorageQueues --version 1.0.0-beta.1
The NuGet Team does not provide support for this client. Please contact itsmaintainers for support.
#r "nuget: Microsoft.CoreWCF.Azure.StorageQueues, 1.0.0-beta.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Microsoft.CoreWCF.Azure.StorageQueues&version=1.0.0-beta.1&prerelease
Install as a Cake Addin
#tool nuget:?package=Microsoft.CoreWCF.Azure.StorageQueues&version=1.0.0-beta.1&prerelease
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact itsmaintainers for support.

CoreWCF Azure Queue Storage library for .NET

CoreWCF Azure Queue Storage is the service side library that will help existing WCF services to be able to use Azure Queue Storage to communicate with clients as a modern replacement to using MSMQ.

Getting started

Install the package

Install the Microsoft.CoreWCF.Azure.StorageQueues library for .NET withNuGet:

dotnet add package Microsoft.CoreWCF.Azure.StorageQueues --prerelease

Prerequisites

You need anAzure subscription and aStorage Account to use this package.

To create a new Storage Account, you can use theAzure portal,Azure PowerShell, or theAzure CLI.Here's an example using the Azure CLI:

az storage account create --name MyStorageAccount --resource-group MyResourceGroup --location westus --sku Standard_LRS

Configure ASP.NET Core to use CoreWCF with Queue transports

In order to receive requests from the Azure Queue Storage service, you'll need to configure CoreWCF to use queue transports.

public void ConfigureServices(IServiceCollection services){    services.AddServiceModelServices()            .AddQueueTransport();}

Authenticate the service to Azure Queue Storage

To receive requests from the Azure Queue Storage service, you'll need to configure CoreWCF with the appropriate endpoint, and configure credentials. TheAzure Identity library makes it easy to add Microsoft Entra ID support for authenticating with Azure services.

There are multiple authentication mechanisms for Azure Queue Storage. Which mechanism to use is configured via the propertyAzureQueueStorageBinding.Security.Transport.ClientCredentialType. The default authentication mechanism isDefault, which usesDefaultAzureCredential.

public void Configure(IApplicationBuilder app){    app.UseServiceModel(serviceBuilder =>    {        // Configure CoreWCF to dispatch to service type Service        serviceBuilder.AddService<Service>();        // Create a binding instance to use Azure Queue Storage, passing an optional queue name for the dead letter queue        // The default client credential type is Default, which uses DefaultAzureCredential        var aqsBinding = new AzureQueueStorageBinding("DEADLETTERQUEUENAME");        // Add a service endpoint using the AzureQueueStorageBinding        string queueEndpointString = "https://MYSTORAGEACCOUNT.queue.core.windows.net/QUEUENAME";        serviceBuilder.AddServiceEndpoint<Service, IService>(aqsBinding, queueEndpointString);    });}

Learn more about enabling Microsoft Entra ID for authentication with Azure Storage inour documentation.

Other authentication credential mechanisms

If you are using a different credential mechanism such asStorageSharedKeyCredential, you configure the appropriateClientCredentialType on the binding and set the credential on anAzureServiceCredentials instance via an extension method.

public void Configure(IApplicationBuilder app){    app.UseServiceModel(serviceBuilder =>    {        // Configure CoreWCF to dispatch to service type Service        serviceBuilder.AddService<Service>();        // Create a binding instance to use Azure Queue Storage, passing an optional queue name for the dead letter queue        var aqsBinding = new AzureQueueStorageBinding("DEADLETTERQUEUENAME");        // Configure the client credential type to use StorageSharedKeyCredential        aqsBinding.Security.Transport.ClientCredentialType = AzureClientCredentialType.StorageSharedKey;        // Add a service endpoint using the AzureQueueStorageBinding        string queueEndpointString = "https://MYSTORAGEACCOUNT.queue.core.windows.net/QUEUENAME";        serviceBuilder.AddServiceEndpoint<Service, IService>(aqsBinding, queueEndpointString);        // Use extension method to configure CoreWCF to use AzureServiceCredentials and set the        // StorageSharedKeyCredential instance.        serviceBuilder.UseAzureCredentials<Service>(credentials =>        {            credentials.StorageSharedKey = GetStorageSharedKey();        });    });}public StorageSharedKeyCredential GetStorageSharedKey(){    // Fetch shared key using a secure mechanism such as Azure Key Vault    // and construct an instance of StorageSharedKeyCredential to return;    return default;}

Other values for ClientCredentialType areSas,Token, andConnectionString. The credentials classAzureServiceCredentials has corresponding properties to set each of these credential types.

Troubleshooting

If there are any errors receiving a message from Azure Queue Storage, the CoreWCF transport will log the details at theDebug log level. You can configure logging for the categoryMicrosoft.CoreWCF at theDebug level to see any errors.

.ConfigureLogging((logging) =>{    logging.AddFilter("Microsoft.CoreWCF", LogLevel.Debug);});

If a message was recevied from the queue, but wasn't able to be processed, it will be placed in the dead letter queue. You can sepcify the dead letter queue name by passing it to the constructor ofAzureQueueStorageBinding. If not specified, the default value ofdefault-dead-letter-queue will be used.

Key concepts

CoreWCF is an implementation of the service side features of Windows Communication Foundation (WCF) for .NET. The goal of this project is to enable migrating existing WCF services to .NET that are currently using MSMQ and wish to deploy their service to Azure, replacing MSMQ with Azure Queue Storage.

More general samples of using CoreWCF can be found in theCoreWCF samples repository. To create a client to send messages to an Azure Storage Queue, see theMicrosoft.WCF.Azure.StorageQueues documentation.

Contributing

See theStorage CONTRIBUTING.md for details on building,testing, and contributing to this library.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visitcla.microsoft.com.

This project has adopted theMicrosoft Open Source Code of Conduct.For more information see theCode of Conduct FAQ or contactopencode@microsoft.com with any additional questions or comments.

ProductCompatible and additional computed target framework versions.
.NETnet5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. 
.NET Corenetcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. 
.NET Standardnetstandard2.0 is compatible. netstandard2.1 was computed. 
.NET Frameworknet461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. 
MonoAndroidmonoandroid was computed. 
MonoMacmonomac was computed. 
MonoTouchmonotouch was computed. 
Tizentizen40 was computed. tizen60 was computed. 
Xamarin.iOSxamarinios was computed. 
Xamarin.Macxamarinmac was computed. 
Xamarin.TVOSxamarintvos was computed. 
Xamarin.WatchOSxamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more aboutTarget Frameworks and.NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

VersionDownloads Last Updated
1.0.0-beta.1 7477/18/2024
Downloads
Total747
Current version747
Per day average2
About
Owners

© Microsoft Corporation. All rights reserved.

Share this package on FacebookShare this package on XUse the Atom feed to subscribe to new versions of Microsoft.CoreWCF.Azure.StorageQueues