简体   繁体   English

使用 Azure AD 验证从 MS Dynamics 365 到 Azure 服务总线

[英]Authenticate from MS Dynamics 365 to Azure Service Bus using Azure AD

I have a MS Dynamics 365 installation.我有一个 MS Dynamics 365 安装。 I also have an Azure subscription with a Service Bus.我还有一个带有服务总线的 Azure 订阅。 I have an Azure AD tenant that they both use.我有一个他们都使用的 Azure AD 租户。

I am wondering how I can authenticate from MSD365 to Azure Service Bus in the best possible way?我想知道如何以最佳方式从 MSD365 到 Azure 服务总线进行身份验证? Can I do this with Azure AD in this setup?我可以在此设置中使用 Azure AD 执行此操作吗?

Upon researching, I can see that another option is the use of Shared Access Signatures.经过研究,我可以看到另一种选择是使用共享访问签名。 However, it doesn't appear to be the recommended way by Microsoft, and I have a funny feeling the security team in my place of work would not fancy it either.但是,这似乎不是微软推荐的方式,而且我有一种有趣的感觉,我工作地点的安全团队也不会喜欢它。

The calls out to Azure Service Bus could be as part of using MSD365, or it could be as part of a workflow.对 Azure 服务总线的调用可以作为使用 MSD365 的一部分,也可以作为工作流的一部分。

Any help would be appreciated.任何帮助,将不胜感激。

UPDATE更新

Removed mention of a different tenant as it wasn't relevant.删除了对不同租户的提及,因为它不相关。

• Since Azure Service Bus only offers connecting/communicating with other applications securely only through SAS connection strings only, there is no other method available to allow MS Dynamics 365 to send or listen messages from queues to or from Azure Service Bus. • 由于 Azure 服务总线仅通过 SAS 连接字符串提供与其他应用程序的安全连接/通信,因此没有其他方法可用于允许 MS Dynamics 365 从队列向 Z3A580F142218F67F 发送或收听来自队列的消息。 Though, you can enhance the security of your integration with MS Dynamics 365 in another tenant though as below: -不过,您可以在另一个租户中增强与 MS Dynamics 365 集成的安全性,如下所示:-

a) You can configure a private service endpoint in your Azure Service Bus subscription for the Queue namespace that you have configured to listen/send messages from/to MS Dynamics 365 in another tenant. a) 您可以在 Azure 服务总线订阅中为您配置的队列命名空间配置专用服务终结点,以在另一个租户中侦听/向 MS Dynamics 365 发送消息。 Through this, you can configure the queue to use private DNS records also by integrating with your private DNS zone in the same tenant or another tenant where your actual organization's AD resides.通过这个,您可以配置队列以使用私有 DNS 记录,也可以通过与您的私有 DNS 区域集成在您的实际组织的 AD 所在的同一租户或另一个租户中。 You can peer your virtual networks from across the tenants to ensure that connection happens over the private network only.您可以跨租户对等虚拟网络,以确保仅通过专用网络进行连接。

Azure 服务总线 - 专用终结点

b) Also, you can configure specific virtual networks to connect in 'Public Access' option and restrict its connection to specific IP address ranges in other tenant for communication. b) 此外,您可以在“公共访问”选项中配置特定的虚拟网络以连接,并将其连接限制到其他租户中特定的 IP 地址范围以进行通信。

Azure 服务总线 - 公共网络

c) Also, you can configure the Azure Service Bus queue in the same tenant which hosts your organization's AD to apply role-based access assignment to specific users, groups, and applications as well as service principals for the specific permissions in that role related to that queue. c) 此外,您可以在托管您组织的 AD 的同一租户中配置 Azure 服务总线队列,以将基于角色的访问分配应用于特定用户、组和应用程序以及服务主体,以获取与该角色相关的特定权限那个队列。

Azure 服务 RBAC

These are the above methods through which you can enhance the security of your integration with Azure Service Bus.这些是上述方法,您可以通过这些方法增强与 Azure 服务总线集成的安全性。

Please find the below links for reference regarding the integration of Microsoft Dynamics 365 to Azure Service Bus: -请查找以下链接以获取有关 Microsoft Dynamics 365 与 Azure 服务总线集成的参考:-

https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/azure-integration?view=op-9-1 https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/azure-integration?view=op-9-1

https://powermaverick.dev/2019/03/10/azure-ad-authentication-with-dynamics-crm/ https://powermaverick.dev/2019/03/10/azure-ad-authentication-with-dynamics-crm/

I managed to get this working using Azure AD.我设法使用 Azure AD 来完成这项工作。

Steps as follows:步骤如下:

  • Create a group in Azure AD and give access to send to the service bus queue在 Azure AD 中创建一个组并授予发送到服务总线队列的权限

  • Create an app registration in Azure AD and add this app to the group在 Azure AD 中创建应用注册并将此应用添加到组

  • Create a private key and public certificate创建私钥和公共证书

  • Upload the public key to the app registration上传公钥到应用注册

  • In a console application (for testing), run the following code, substituting in the relevant values in the variables:在控制台应用程序(用于测试)中,运行以下代码,替换变量中的相关值:

     string tenantId = "xxx"; string clientId = "xxx"; string clientCertPath = "mykey.pem"; string queueName = "xxx"; string fullyQualifiedNamespace = "xxx.servicebus.windows.net"; TokenCredential credential = new ClientCertificateCredential(tenantId, clientId, clientCertPath); var client = new ServiceBusClient(fullyQualifiedNamespace, credential); ServiceBusSender sender = client.CreateSender(queueName); ServiceBusMessage busMessage = new ServiceBusMessage("test"); sender.SendMessageAsync(busMessage).Wait();

This appears to be a more secure way to integrate, rather than using Shared Access Signatures (SAS).这似乎是一种更安全的集成方式,而不是使用共享访问签名 (SAS)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure 服务总线如何使用 Azure AD 对客户端进行身份验证 - How can Azure Service Bus authenticate clients using Azure AD 筛选从 Dynamics 365 发布到 Azure 服务总线的消息 - Filtering of messages posted from Dynamics 365 to Azure Service Bus 通过Azure功能通过Dynamics 365进行身份验证 - Authenticate with Dynamics 365 from an Azure Function 如何使用 Azure AD 验证\授权在本地运行的控制台应用程序以使用 Azure 服务总线 - How to authenticate\authorize a console application running on-prem to use Azure service bus using Azure AD 从Dynamics导航生成Azure Service Bus SAS令牌 - Generate Azure Service Bus SAS Token from Dynamics NAV 天蓝色服务总线和动态CRM集成 - azure service bus & dynamics crm integration 使用版本号从 Dynamics 365 使用 Azure Synapse 更新行 - Upserting rows with Azure Synapse from Dynamics 365 using versionnumber 如何使用Azure AD对Windows服务进行身份验证以将事件上载到Office 365日历? - How to authenticate a windows service with Azure AD to upload events to Office 365 Calendar? 从Silverlight使用Windows Azure Service Bus - Using Windows Azure Service Bus From Silverlight 如何使用 Azure AD 向 web 服务验证移动应用程序? - How to authenticate mobile app to web service using Azure AD?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM