title: The connection was inactive for more than the allowed 60000 milliseconds and is closed by container
body: <p>I have an azure function that sends a message to the service bus queue. Since a recent deployment, I see an exception occurring frequently: The connection was inactive for more than the allowed 60000 milliseconds and is closed by container.</p>
  <p><a href="https://i.stack.imgur.com/tAvsF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tAvsF.png" alt="enter image description here" /></a></p>
  <p>I looked into this GitHub post: <a href="https://github.com/Azure/azure-service-bus-java/issues/280" rel="nofollow noreferrer">https://github.com/Azure/azure-service-bus-java/issues/280</a> it says this is a warning. Is there a way to increase this timeout? Or any suggestions on how to resolve this? Here is my code:</p>
  <pre><code>
  namespace Repositories.ServiceBusQueue
  {
      public class MembershipServiceBusRepository : IMembershipServiceBusRepository
      {
          private readonly QueueClient _queueClient;
          public MembershipServiceBusRepository(string serviceBusNamespacePrefix, string queueName)
          {
              var msiTokenProvider = TokenProvider.CreateManagedIdentityTokenProvider();
              _queueClient = new QueueClient($&quot;https://{serviceBusNamespacePrefix}.servicebus.windows.net&quot;, queueName, msiTokenProvider);
          }
          public async Task SendMembership(GroupMembership groupMembership, string sentFrom = &quot;&quot;)
          {
              if (groupMembership.SyncJobPartitionKey == null) { throw new ArgumentNullException(&quot;SyncJobPartitionKey must be set.&quot;); }
              if (groupMembership.SyncJobRowKey == null) { throw new ArgumentNullException(&quot;SyncJobRowKey must be set.&quot;); }
              foreach (var message in groupMembership.Split().Select(x =&gt; new Message
              {
                  Body = Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(x)),
                  SessionId = groupMembership.RunId.ToString(),
                  ContentType = &quot;application/json&quot;,
                  Label = sentFrom
              }))
              {
                  await _queueClient.SendAsync(message);
              }
          }
      }
  }
  
  </code></pre>