Skip to content
This repository has been archived by the owner on Feb 10, 2021. It is now read-only.

Commit

Permalink
Fixed name - should be ServiceBus connection string instead of Event …
Browse files Browse the repository at this point in the history
…Hub connection string.
  • Loading branch information
dinarisio committed Feb 12, 2016
1 parent d853ae6 commit f6b4608
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Azure/AppToNotifyUsers/WorkerHost/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
To find, open Azure management portal, select Namespace -> Event Hub -> connection information -> connection string
Example format (imaginary values):
<add key="Microsoft.ServiceBus.EventHubToMonitor" value="ehalerts" />
<add key="Microsoft.ServiceBus.EventHubConnectionString" value="Endpoint=sb://mynamespace.servicebus.windows.net/;SharedAccessKeyName=MyPolicyName;SharedAccessKey=G3d70qqNuiRnChdhZh120oHml9t6xLbTNuxxrHJ0vHY=" />
<add key="Microsoft.ServiceBus.ServiceBusConnectionString" value="Endpoint=sb://mynamespace.servicebus.windows.net/;SharedAccessKeyName=MyPolicyName;SharedAccessKey=G3d70qqNuiRnChdhZh120oHml9t6xLbTNuxxrHJ0vHY=" />
-->
<add key="Microsoft.ServiceBus.EventHubToMonitor" value="[event hub name]" />
<add key="Microsoft.ServiceBus.EventHubConnectionString" value="[event hub connection string]" />
<add key="Microsoft.ServiceBus.EventHubToMonitor" value="[Event Hub name]" />
<add key="Microsoft.ServiceBus.ServiceBusConnectionString" value="[Service Bus connection string]" />
<!--Should be different consumer group for each Worker Role/EH pair-->
<add key="ConsumerGroupPrefix" value="Monitor" />

Expand Down
6 changes: 3 additions & 3 deletions Azure/AppToNotifyUsers/WorkerHost/ConfigurationLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ namespace WorkerHost
{
public class AppConfiguration
{
public string DeviceEHConnectionString;
public string DeviceSBConnectionString;
public string DeviceEHName;


Expand Down Expand Up @@ -155,8 +155,8 @@ public static AppConfiguration GetConfig()

AppConfiguration config = new AppConfiguration
{
DeviceEHConnectionString =
ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.EventHubConnectionString"),
DeviceSBConnectionString =
ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.ServiceBusConnectionString"),
DeviceEHName = ConfigurationManager.AppSettings.Get("Microsoft.ServiceBus.EventHubToMonitor"),
NotificationService = ConfigurationManager.AppSettings.Get("NotificationService"),
EmailServiceUserName = ConfigurationManager.AppSettings.Get("SenderUserName"),
Expand Down
2 changes: 1 addition & 1 deletion Azure/AppToNotifyUsers/WorkerHost/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private static void PrepareMailAddressInstances()

public static void Process()
{
_EventHubReader.Run(_Config.DeviceEHConnectionString, _Config.DeviceEHName, string.Empty);
_EventHubReader.Run(_Config.DeviceSBConnectionString, _Config.DeviceEHName, string.Empty);
_EventHubReader.FailureEvent.WaitOne();
}

Expand Down
8 changes: 4 additions & 4 deletions Azure/AppToNotifyUsers/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ There are three sections of App.config you will need to change - to specify the
## Step 1: Specifying the Event Hub to Monitor ##
The code in the [AppToNotifyUsers](https://github.com/Azure/connectthedots/tree/master/Azure/AppToNotifyUsers) solution creates an Azure Cloud Service (worker role) that monitors an event hub identified by a URL you list a config file, App.config, together with the Shared Key that grants you access. The strings in App.config that needs to be modified are the following:
```
<add key="Microsoft.ServiceBus.EventHubToMonitor" value="[event hub name]" />
<add key="Microsoft.ServiceBus.EventHubConnectionString" value="[event hub connection string]" />
<add key="Microsoft.ServiceBus.EventHubToMonitor" value="[Event Hub name]" />
<add key="Microsoft.ServiceBus.ServiceBusConnectionString" value="[Service Bus connection string]" />
```
If you deploy the example in the Connect The Dots, that event hub is called ehalerts, and you would replace [event hub name] with 'ehalerts', and the EventHubConnectionString string with the connection string for it, that you can find in the Azure management portal. It should look something like this:
If you deploy the example in the Connect The Dots, that event hub is called ehalerts, and you would replace [Event Hub name] with 'ehalerts', and the ServiceBusConnectionString string with the connection string for it, that you can find in the Azure management portal. It should look something like this:

```
<add key="Microsoft.ServiceBus.EventHubToMonitor" value="ehalerts" />
<add key="Microsoft.ServiceBus.EventHubConnectionString" value="Endpoint=sb://mynamespace-ns.servicebus.windows.net/;SharedAccessKeyName=StreamingAnalytics;SharedAccessKey=X4a22abcXiRnA3dhBbzu0oHml3a6aLbTNuffrHJ0vHY=" />
<add key="Microsoft.ServiceBus.ServiceBusConnectionString" value="Endpoint=sb://mynamespace-ns.servicebus.windows.net/;SharedAccessKeyName=StreamingAnalytics;SharedAccessKey=X4a22abcXiRnA3dhBbzu0oHml3a6aLbTNuffrHJ0vHY=" />
```
The EventHubReader module in the code uses this information to get messages from ehalerts, and put it in a queue to be sent by whatever method you specify.

Expand Down

0 comments on commit f6b4608

Please sign in to comment.