You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to interact with the Event Grid service, you will need to create an instance of a client.
39
39
An **endpoint** and **credential** are necessary to instantiate the client object.
40
40
41
+
#### Using Azure Active Directory (AAD)
42
+
43
+
Azure Event Grid provides integration with Azure Active Directory (Azure AD) for identity-based authentication of requests. With Azure AD, you can use role-based access control (RBAC) to grant access to your Azure Event Grid resources to users, groups, or applications.
44
+
45
+
To send events to a topic or domain with a `TokenCredential`, the authenticated identity should have the "EventGrid Data Sender" role assigned.
46
+
47
+
With the `azure-identity` package, you can seamlessly authorize requests in both development and production environments. To learn more about Azure Active Directory, see the [`azure-identity` README](https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/identity/azure-identity/README.md).
48
+
49
+
For example, you can use `DefaultAzureCredential` to construct a client which will authenticate using Azure Active Directory:
50
+
51
+
```Python
52
+
from azure.identity import DefaultAzureCredential
53
+
from azure.eventgrid import EventGridPublisherClient, EventGridEvent
0 commit comments