How to get a list of existing topics in an Azure EventGrid Domain in C#

試著忘記壹切 提交于 2019-12-24 20:56:48

问题


What is the best way to retrieve a list of topic names that are encapsulated by an Azure EventGrid Domain in C#?

It is easy enough to do this with Azure-CLI, but struggling to find examples of this in C#. I've looked at EventGridManagementClient with usage sample here, however, I feel there is too much overhead to try and get this to work, mainly to do with credentials and authentication.


回答1:


You can use the REST API call Domain Topics - List By Domain to get the list all the topics in a domain. Once your application has an Authorization Bearer access token, you can get any resource.

Have a look at my article Azure Event Grid Tester based on the Azure API Management using a REST API calls.

The following screen snippet shows getting a list of all the topics in a domain by Azure Event Grid Tester:



来源:https://stackoverflow.com/questions/57469609/how-to-get-a-list-of-existing-topics-in-an-azure-eventgrid-domain-in-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!