Skip to content

Commit d6b17e9

Browse files
committed
EventHubScriptBindingProvider should set the connection on the attribute
Related to Azure/azure-webjobs-sdk#1417
1 parent 8d8e47c commit d6b17e9

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/WebJobs.Script/Binding/ServiceBusScriptBindingProvider.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,28 +148,24 @@ public override Collection<Attribute> GetAttributes()
148148
}
149149

150150
string connectionString = Context.GetMetadataValue<string>("connection");
151-
if (!string.IsNullOrEmpty(connectionString))
152-
{
153-
connectionString = _nameResolver.Resolve(connectionString);
154-
}
155151

156152
if (Context.IsTrigger)
157153
{
158154
var attribute = new EventHubTriggerAttribute(eventHubName);
155+
attribute.Connection = connectionString;
159156
string consumerGroup = Context.GetMetadataValue<string>("consumerGroup");
160157
if (consumerGroup != null)
161158
{
162159
consumerGroup = _nameResolver.ResolveWholeString(consumerGroup);
163160
attribute.ConsumerGroup = consumerGroup;
164161
}
165162
attributes.Add(attribute);
166-
_eventHubConfiguration.AddReceiver(eventHubName, connectionString);
167163
}
168164
else
169165
{
170-
attributes.Add(new EventHubAttribute(eventHubName));
171-
172-
_eventHubConfiguration.AddSender(eventHubName, connectionString);
166+
var attribute = new EventHubAttribute(eventHubName);
167+
attribute.Connection = connectionString;
168+
attributes.Add(attribute);
173169
}
174170

175171
return attributes;

0 commit comments

Comments
 (0)