Skip to content

Commit

Permalink
First round of PR feedback changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mconnew committed Feb 26, 2024
1 parent 97d8ed6 commit f66a368
Show file tree
Hide file tree
Showing 14 changed files with 175 additions and 263 deletions.
21 changes: 17 additions & 4 deletions eng/Packages.Data.props
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@
<PackageReference Update="ApprovalUtilities" Version="3.0.22" />
<PackageReference Update="Azure.Identity" Version="1.10.4" />
<PackageReference Update="Azure.Messaging.EventGrid" Version="4.17.0" />
<PackageReference Update="Azure.Messaging.EventHubs.Processor" Version="5.11.0" />
<PackageReference Update="Azure.Messaging.EventHubs.Processor" Version="5.11.0" />
<PackageReference Update="Azure.Messaging.ServiceBus" Version="7.16.0" />
<PackageReference Update="Azure.ResourceManager.Compute" Version="1.2.0" />
<PackageReference Update="Azure.ResourceManager.CognitiveServices" Version="1.3.0" />
Expand All @@ -237,9 +237,9 @@
<PackageReference Update="Azure.ResourceManager.RecoveryServices" Version="1.1.0" />
<PackageReference Update="Azure.ResourceManager.Resources" Version="1.6.0" />
<PackageReference Update="Azure.ResourceManager.Storage" Version="1.1.1" />
<PackageReference Update="Azure.ResourceManager.Kubernetes" Version="1.0.0-beta.3" />
<PackageReference Update="Azure.ResourceManager.KubernetesConfiguration" Version="1.2.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.ExtendedLocations" Version="1.1.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.Kubernetes" Version="1.0.0-beta.3" />
<PackageReference Update="Azure.ResourceManager.KubernetesConfiguration" Version="1.2.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.ExtendedLocations" Version="1.1.0-beta.1" />
<PackageReference Update="Azure.ResourceManager.EventHubs" Version="1.0.0" />
<PackageReference Update="Azure.ResourceManager.ContainerRegistry" Version="1.1.0" />
<PackageReference Update="Azure.Search.Documents" Version="11.2.0" />
Expand Down Expand Up @@ -341,6 +341,19 @@
<PackageDownload Update="NETStandard.Library.Ref" Version="[2.1.0]" />
</ItemGroup>

<ItemGroup Condition="'$(IsWcfLibrary)' == 'true'">
<PackageReference Update="CoreWCF.Queue" Version="1.5.1" />
<PackageReference Update="System.IO.Pipelines" Version="6.0.3" />
<PackageReference Update="Microsoft.AspNetCore" Version="2.1.0" />
<PackageReference Update="Microsoft.Extensions.Logging.Configuration" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Primitives" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Update="Microsoft.Extensions.Configuration.UserSecrets" Version="6.0.1" />
<PackageReference Update="System.ServiceModel.Primitives" Version="6.2.0" />
<PackageReference Update="Azure.Storage.Files.Shares" Version="12.17.1" />
<PackageReference Update="Azure.Storage.Queues" Version="12.17.1" />
</ItemGroup>

<PropertyGroup>
<TestProxyVersion>1.0.0-dev.20230821.1</TestProxyVersion>
</PropertyGroup>
Expand Down
13 changes: 7 additions & 6 deletions sdk/extensions/wcf/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<Project>
<!-- Need to set IsClientLibrary for CentralPackageManagement versions file in $(root)\eng\Packages.Data.props -->
<PropertyGroup>
<IsClientLibrary Condition="'$(IsClientLibrary)' == '' and $(MSBuildProjectName.StartsWith('Microsoft.'))">true</IsClientLibrary>
<IsTestProject Condition="'$(IsTestProject)' == '' and $(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>
</PropertyGroup>
<!-- Need to set IsClientLibrary for CentralPackageManagement versions file in $(root)\eng\Packages.Data.props -->
<PropertyGroup>
<IsClientLibrary Condition="'$(IsClientLibrary)' == '' and $(MSBuildProjectName.StartsWith('Microsoft.'))">true</IsClientLibrary>
<IsTestProject Condition="'$(IsTestProject)' == '' and $(MSBuildProjectName.EndsWith('.Tests'))">true</IsTestProject>
<IsWcfLibrary>true</IsWcfLibrary>
</PropertyGroup>

<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))"/>
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props, $(MSBuildThisFileDirectory)..))"/>
</Project>
88 changes: 0 additions & 88 deletions sdk/extensions/wcf/Microsoft.CoreWCF.Azure.StorageQueues/README.MD

This file was deleted.

79 changes: 79 additions & 0 deletions sdk/extensions/wcf/Microsoft.CoreWCF.Azure.StorageQueues/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# CoreWCF Azure Queue Storage library

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 with [NuGet][nuget]:

```dotnetcli
dotnet add package Microsoft.CoreWCF.Azure.StorageQueues
```

### Prerequisites

You need an [Azure subscription][azure_sub] and a
[Storage Account][storage_account_docs] to use this package.

To create a new Storage Account, you can use the [Azure Portal][storage_account_create_portal],
[Azure PowerShell][storage_account_create_ps], or the [Azure CLI][storage_account_create_cli].
Here's an example using the Azure CLI:

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

### Authenticate the service to Azure

In order to receive requests from the Azure Queue Storage service, you'll need to configure CoreWCF with the appropriate endpoint and credentials. The [Azure Identity library][identity] makes it easy to add Azure Active Directory support for authenticating with Azure services.

```C# Snippet:CoreWCF_Azure_Storage_Queues_Sample_DefaultAzureCredential
app.UseServiceModel(services =>
{
// Configure CoreWCF to dispatch to service type Service
services.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 DefaultAzureCredential
binding.Security.Transport.ClientCredentialType = AzureClientCredentialType.Default;
string queueEndpointString = "https://MYSTORAGEACCOUNT.queue.core.windows.net/QUEUENAME";
services.AddServiceEndpoint<Service, IServiceContract>(aqsBinding, queueEndpointString);
});
```
Learn more about enabling Azure Active Directory for authentication with Azure Storage in [our documentation][storage_ad].

If you are using a different credential mechanism such as `StorageSharedKeyCredential`, you can configure the appropriate `ClientCredentialType` and set the credential on an `AzureServiceCredential` instance via an extension method.
```C# Snippet:CoreWCF_Azure_Storage_Queus_Sample_StorageSharedKey
StorageSharedKeyCredential storageSharedKey = GetStorageSharedKey();
app.UseServiceModel(services =>
{
// Configure CoreWCF to dispatch to service type Service
services.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
binding.Security.Transport.ClientCredentialType = AzureClientCredentialType.StorageSharedKey;
string queueEndpointString = "https://MYSTORAGEACCOUNT.queue.core.windows.net/QUEUENAME";
services.AddServiceEndpoint<Service, IServiceContract>(aqsBinding, queueEndpointString);
services.UseAzureCredentials<Service>(credentials =>
{
credentials.StorageSharedKey = storageSharedKey;
});
});
```
## 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.

<!-- LINKS -->
[nuget]: https://www.nuget.org/
[storage_account_docs]: https://docs.microsoft.com/azure/storage/common/storage-account-overview
[storage_account_create_ps]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-powershell
[storage_account_create_cli]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-cli
[storage_account_create_portal]: https://docs.microsoft.com/azure/storage/common/storage-quickstart-create-account?tabs=azure-portal
[azure_cli]: https://docs.microsoft.com/cli/azure
[azure_sub]: https://azure.microsoft.com/free/dotnet/
[identity]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/identity/Azure.Identity/README.md
[storage_ad]: https://docs.microsoft.com/azure/storage/common/storage-auth-aad
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ public override T GetProperty<T>(BindingContext context)
return base.GetProperty<T>(context);
}

/// <summary>
/// Configures CoreWCF with a dummy net.aqs base address in the case that the endpoint uri is provided in a connection string.
/// </summary>
/// <param name="app">The ASP.NET Core application builder for the service</param>
void ITransportServiceBuilder.Configure(IApplicationBuilder app)
{
// When using a ConnectionString, the queue endpoint url could be provided
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\storage\Azure.Storage.Common\tests\Azure.Storage.Common.Tests.csproj" />
<ProjectReference Include="..\..\..\..\storage\Azure.Storage.Queues\src\Azure.Storage.Queues.csproj" />
<ProjectReference Include="..\src\Microsoft.CoreWCF.Azure.StorageQueues.csproj" />
</ItemGroup>

Expand Down
Loading

0 comments on commit f66a368

Please sign in to comment.