title: Service Bus Connection String in Azure function is rejected
body: <p>Im working through <a href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-store-data-in-azure-table-storage" rel="nofollow noreferrer">this</a> guide using <strong>Azure Functions</strong> to commit <strong>IoTHub</strong> messages to <strong>Azure storage</strong>. I'm at section 5d, where I need to create a new Service Bus Connection string for my function, but whatever I use, including the format in the guide:</p>
  
  <pre><code>Endpoint=&lt;Event Hub-compatible endpoint&gt;;SharedAccessKeyName=iothubowner;SharedAccessKey=&lt;Primary key&gt;
  </code></pre>
  
  <p>I get the error:</p>
  
  <blockquote>
    <p>Not a valid service bus connection string.</p>
  </blockquote>
  
  <p>I’ve tried using the <code>Event Hub-compatible endpoint</code> from my IoT hub endpoints and also the <code>connection string –- primary key</code> from the access policy for iothubowner but again it rejects it.</p>
  
  <p>I then created a new service bus and used that connection (see my answer below and initial optimism!) but when I tried to edit the function I get a 404 toast notification:</p>
  
  <blockquote>
    <p>Function ($DeviceDataToStorage) Error: The listener for function
    'Functions.DeviceDataToStorage' was unable to start.
    Microsoft.ServiceBus: The messaging entity 'Management operation
    failed. status-code: 404, status-description: The messaging entity
    'sb://{MY SERVICE BUS CONNECTION STRING WHICH WAS
    ACCEPTED}/{EVENTHUBNAME}' could not be found..' could not be found.</p>
  </blockquote>
  
  <p>Can anyone who has used Azure functions before advise what format this needs to be in or more importantly where exactly in the portal I can get this from?</p>