The task library has also got a set of MsBuild tasks above it in an assembly called AppFx.ServiceBus.Build.MsBuild.dll

The below script shows an example of referencing this library and associated artefacts to create and setup a service bus namespace with MsBuild.


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="AppFx.ServiceBus.Build.MsBuild.tasks"/>

<PropertyGroup>
<ServiceBusNamespace>MyNamespace-@@LocalMachineName@@</ServiceBusNamespace>
<SasRuleName>Developer</SasRuleName>
<SasKey>FP8jSHF7aSLoaFuh6M1yQ/KNyebvfCyPxE40lxL4Q=</SasKey>
<ManagementCertificatePath>SBTesting.pfx</ManagementCertificatePath>
<ManagementCertificatePassword>password</ManagementCertificatePassword>
<SubscriptionId>{Guid Goes Here}</SubscriptionId>
<ConnectionString>Endpoint=sb://MyNamespace-@@LocalMachineName@@.servicebus.windows.net/;SharedAccessKeyName=Developer;SharedAccessKey=FP8jSHF7aSLoaFuh6M1yQ/KNyebvfCyPxE40lxL4Q=</ConnectionString>
<ImportEntitiesPath>SB_Entities.xml</ImportEntitiesPath>
<ExportEntitiesPath>Export_Entities.xml</ExportEntitiesPath>
</PropertyGroup>

<Target Name="Build">

<AppFx.ServiceBus.Build.MsBuild.Namespace.ExportEntities
PathToExport="$(ExportEntitiesPath)"
ConnectionString="$(ConnectionString)"
ContinueOnError="true"/>

<AppFx.ServiceBus.Build.MsBuild.Namespace.Delete
ManagementCertificatePath="$(ManagementCertificatePath)"
ManagementCertificatePassword="$(ManagementCertificatePassword)"
NamespaceName="$(ServiceBusNamespace)"
SubscriptionID="$(SubscriptionId)"
ContinueOnError="true"/>

<AppFx.ServiceBus.Build.MsBuild.Namespace.Create
ManagementCertificatePath="$(ManagementCertificatePath)"
ManagementCertificatePassword="$(ManagementCertificatePassword)"
NamespaceName="$(ServiceBusNamespace)"
SubscriptionID="$(SubscriptionId)"
Region="North Europe"/>

<AppFx.ServiceBus.Build.MsBuild.SAS.CreateFullManageRuleGroup
ManagementCertificatePath="$(ManagementCertificatePath)"
ManagementCertificatePassword="$(ManagementCertificatePassword)"
NamespaceName="$(ServiceBusNamespace)"
SubscriptionID="$(SubscriptionId)"
RuleName="$(SasRuleName)"
SasKey="$(SasKey)"/>

<AppFx.ServiceBus.Build.MsBuild.Namespace.ImportEntities
PathToImport="$(ImportEntitiesPath)"
ConnectionString="$(ConnectionString)"/>

</Target>
</Project>


Last edited Nov 14, 2013 at 12:51 AM by michaelstephenson, version 1