title: Using IAM for Azure Service Bus, how can I assign a role to an application?
body: <h2>Background</h2>
  
  <p>I want to give an application ownership of several of my Azure Service Bus queues ... specifically, by granting it the <strong>Azure Service Bus Data Owner</strong> role.</p>
  
  <p>The Azure Service Bus documentation says this is possible:</p>
  
  <blockquote>
    <p>Azure Service Bus supports using Azure Active Directory (Azure AD) to authorize requests to Service Bus entities (queues, topics, subscriptions, or filters). With Azure AD, you can use role-based access control (RBAC) to grant permissions to a security principal, which may be a user, group, or <strong>application service principal</strong> [my emphasis].</p>
    
    <p>(<a href="https://docs.microsoft.com/en-us/azure/service-bus-messaging/authenticate-application" rel="nofollow noreferrer">Source</a>)</p>
  </blockquote>
  
  <p>However, I can't find a way to do it.</p>
  
  <h2>What I've Tried</h2>
  
  <ol>
  <li>Registered the application in Azure AD.</li>
  <li>Granted the application the <code>user_impersonation</code> permission on <code>Microsoft.ServiceBus</code>. (<code>Application permissions</code> is disabled [1], so I selected <code>Delegated permissions</code> and checked <code>user_impersonation</code> [2]. No idea if that's right. I posted <a href="https://stackoverflow.com/questions/57379397/">another question</a> a while ago about <code>Application permissions</code> being disabled, but the accepted answer of editing the manifest doesn't work in this case.)
  <a href="https://i.stack.imgur.com/4NyXF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4NyXF.png" alt="enter image description here"></a></li>
  <li>In my Service Bus queue, selected <code>Role assignments</code>.</li>
  <li>Clicked <code>Add</code>.</li>
  <li>Searched for my application.</li>
  </ol>
  
  <h2>Issue</h2>
  
  <p>My application doesn't appear in the search results in <code>Role assignments</code>.</p>