Creating a Service Bus URI
A Windows Azure Service Bus URI is a universal resource identifier (URI) that describes the location at which an endpoint is exposed on the Service Bus. You use an Service Bus URI when you connect with both a service and client application. You also use an Service Bus URI when you connect to retrieve tokens for authentication and credential verification with the Access Control service. While you can manually create the URI, or store it in the App.config file, we recommend that you use the CreateServiceUri or CreateAccessControlUri methods to create your URIs, as those members contain all the relevant default settings.
|The Service Bus performs case-insensitive comparisons of service namespaces to align with the behavior of . Because Access Control is designed as a general purpose access control service, it performs case-sensitive comparisons of service namespaces and scopes. Thus, applications that rely on Access Control can decide to be case sensitive or case insensitive, depending on the needs of that application. When designing applications that support multitenancy, you should realize that Access Control performs case-sensitive comparisons and Service Bus performs case-insensitive comparisons, if this difference in behavior produces unexpected results in your application. Because Access Control prevents creating scopes that differ only by case, this difference in behavior should not present a security issue.|
To create an Access Control or Service Bus URI
The following example, taken from the Echo sample in the Windows Azure SDK, shows how to programmatically create an Service Bus URI.
Console.Write("Your Service Namespace (ex. sb://<ServiceNamespace>.servicebus.windows.net/): "); string serviceNamespace = Console.ReadLine(); Console.Write("Your Issuer Name: "); string issuerName = Console.ReadLine(); Console.Write("Your Issuer Secret: "); string issuerSecret = Console.ReadLine(); // create the service URI based on the solution name Uri address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "EchoService");