title: Using InteractiveBrowserCredential to authenticate to Azure Key Vault on production won't work
body: <p>I want to read a secret from Azure Key Vault from my ASP.NET web application. In order to do that I don't want to authenticate the application (service principal), but the individual users (user principal). From all the possible credential types, I've concluded the best one to achieve this is
  InteractiveBrowserCredential:</p>
  <p><em>DefaultAzureCredential
  ManagedIdentityCredential<br />
  EnvironmentCredential<br />
  ClientSecretCredential<br />
  CertificateCredential<br />
  UserPasswordCredential<br />
  DeviceCodeCredential<br />
  <strong>InteractiveBrowserCredential</strong></em></p>
  <p>Here's my code:</p>
  <pre><code>var client = new SecretClient(new Uri(keyVaultUrl), new InteractiveBrowserCredential();
  KeyVaultSecret secret = client.GetSecret(secretName);
  string password = secret.Value;
  </code></pre>
  <p>This works well on localhost - I get prompted for my Azure AD user and password, and I have access to the vault. However, I notice this is not my default browser but a IIS Express worker process instead.</p>
  <p><a href="https://i.stack.imgur.com/JN4ux.png" rel="nofollow noreferrer">1</a></p>
  <p>When running this same code on production, I get the following error:</p>
  <blockquote>
  <p>Azure.Identity.AuthenticationFailedException:
  InteractiveBrowserCredential authentication failed: <strong>Showing a modal
  dialog box or form when the application is not running in
  UserInteractive mode is not a valid operation.</strong> Specify the
  ServiceNotification or DefaultDesktopOnly style to display a
  notification from a service application. ---&gt;
  System.InvalidOperationException</p>
  </blockquote>
  <p>Afaik it should be opening a browser, not a modal dialog. Can someone help my understand what's going on here?</p>