如何在 C# 中获取 Azure EventGrid 域中现有主题的列表 [英] How to get a list of existing topics in an Azure EventGrid Domain in C#

查看:21
本文介绍了如何在 C# 中获取 Azure EventGrid 域中现有主题的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 C# 中检索由 Azure EventGrid 域封装的主题名称列表的最佳方法是什么?

使用 Azure-CLI 很容易做到这一点,但很难在 C# 中找到这样的例子.我看过

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.

解决方案

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:

这篇关于如何在 C# 中获取 Azure EventGrid 域中现有主题的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆