我可以使用 Terraform 将 azure 函数添加到 DPS 吗?

Can I add azure functions to a DPS using Terraform?

我是 Terraform 和 Azure 的新手。在 6 周的时间内,我必须创建一个 IoT 解决方案。我只剩下 3 周了。

我必须使用 DPS 在 IoT 中心配置设备,如果没记错,DPS 使用 azure 函数来执行此操作。

我的问题是,如何使用 terraform 将 azure 函数添加到 dps,或者这是不可能的,难道我完全错了吗?

DPS 不需要 Azure Functions 来实现基本功能。仅当您执行 custom allocation policies. If all you want to do is have an IoT Hub assigned from a pool of one or more Hubs, then one of the built-in allocation policies will work, as described in the overview:

时才需要

Multiple allocation policies to control how DPS assigns devices to IoT hubs in support of your scenarios: Lowest latency, evenly weighted distribution (default), and static configuration via the enrollment list. Latency is determined using the same method as Traffic Manager.

文档解释 how to select this in the Portal, and since you mention you're using Terraform, the provider does this using the allocation_policy setting according to the provider documentation

我知道您时间紧迫,但您可能会在 Microsoft Learn 找到 AZ-220 exam worth your time. There is a learning path about device provisioning, and the information on load balancing is covered in that (for example, at this lesson 的 self-paced 培训。