title: Azure IoT hub basic receiving example, AMQP error
body: <p>I'm delving into azure Iot hubs and connected technologie for work, using the tutorial found here: <a href="https://azure.microsoft.com/nl-nl/documentation/articles/iot-hub-csharp-csharp-getstarted/" rel="nofollow">https://azure.microsoft.com/nl-nl/documentation/articles/iot-hub-csharp-csharp-getstarted/</a></p>
  
  <p>When running the receiver example (this section of the article: <a href="https://azure.microsoft.com/nl-nl/documentation/articles/iot-hub-csharp-csharp-getstarted/#receive-device-to-cloud-messages" rel="nofollow">https://azure.microsoft.com/nl-nl/documentation/articles/iot-hub-csharp-csharp-getstarted/#receive-device-to-cloud-messages</a>)</p>
  
  <p>I get an error on the line: </p>
  
  <pre><code>var d2cPartitions = eventHubClient.GetRuntimeInformation().PartitionIds;
  </code></pre>
  
  <p>I get this error (complete error log at the bottom):</p>
  
  <pre><code>Message=An AMQP error occurred (condition='amqp:link:redirect').
  </code></pre>
  
  <p>I cannot find what causes this, since I use a basic example, and my hub appears rightly configured. Sending works fine btw.
  Anyone got an idea?</p>
  
  <p>Complete error log:</p>
  
  <pre><code>Microsoft.ServiceBus.Messaging.MessagingException was unhandled
    HResult=-2146233088
    IsTransient=true
    Message=An AMQP error occurred (condition='amqp:link:redirect').
    Source=Microsoft.ServiceBus
    StackTrace:
  Server stack trace: 
  Exception rethrown at [0]: 
     at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
     at Microsoft.ServiceBus.Messaging.AmqpClient.AmqpManagementLink.EndCreateManagementLink(IAsyncResult result)
     at Microsoft.ServiceBus.Messaging.Amqp.FaultTolerantObject`1.CreateAsyncResult.&lt;GetAsyncSteps&gt;b__4(CreateAsyncResult thisPtr, IAsyncResult r)
     at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
  Exception rethrown at [1]: 
     at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
     at Microsoft.ServiceBus.Common.AsyncResult`1.End(IAsyncResult asyncResult)
     at Microsoft.ServiceBus.Messaging.Amqp.FaultTolerantObject`1.OnEndCreateInstance(IAsyncResult asyncResult)
     at Microsoft.ServiceBus.Messaging.SingletonManager`1.EndGetInstance(IAsyncResult asyncResult)
     at Microsoft.ServiceBus.Messaging.AmqpClient.AmqpManagementLink.AmqpManagementOperationAsyncResult`1.&lt;GetAsyncSteps&gt;b__21(T thisPtr, IAsyncResult r)
     at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
  Exception rethrown at [2]: 
     at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
     at Microsoft.ServiceBus.Messaging.Amqp.AmqpEventHubClient.GetRuntimeInfoAsyncResult.&lt;GetAsyncSteps&gt;b__18(GetRuntimeInfoAsyncResult thisPtr, IAsyncResult r)
     at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.StepCallback(IAsyncResult result)
  Exception rethrown at [3]: 
     at Microsoft.ServiceBus.Common.AsyncResult.End[TAsyncResult](IAsyncResult result)
     at Microsoft.ServiceBus.Messaging.IteratorAsyncResult`1.RunSynchronously()
     at Microsoft.ServiceBus.Messaging.Amqp.AmqpEventHubClient.GetRuntimeInformation()
     at ReadDeviceToCloudMessages.Program.Main(String[] args) in C:\Users\tmartena\documents\visual studio 2015\Projects\azureTestDevice\ReadDeviceToCloudMessages\Program.cs:line 21
     at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
     at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
     at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
     at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
     at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Threading.ThreadHelper.ThreadStart()
  InnerException:
  </code></pre>