How to use the @azure/event-hubs.EventHubClient.createFromAadTokenCredentials function in @azure/event-hubs

To help you get started, we’ve selected a few @azure/event-hubs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / samples / interactiveLogin.ts View on Github external
async function main(): Promise {
  const credentials = await interactiveLogin({ tokenAudience: "https://eventhubs.azure.net/" });
  const client = EventHubClient.createFromAadTokenCredentials(evenHubsEndpoint, eventHubsName, credentials);
  /*
   Refer to other samples, and place your code here
   to send/receive events
  */
  await client.close();
}
github Azure / azure-sdk-for-js / sdk / eventhub / event-hubs / samples / loginWithAzureAccount.ts View on Github external
async function main(): Promise {
  const credentials = await loginWithUsernamePassword(username, password, {
    tokenAudience: "https://eventhubs.azure.net/"
  });
  const client = EventHubClient.createFromAadTokenCredentials(evenHubsEndpoint, eventHubsName, credentials);
  /*
   Refer to other samples, and place your code here
   to send/receive events
  */
  await client.close();
}