使用 Azure 混合连接进行集成测试

Integration tests with Azure Hybrid Connection

我有一个 ASP.NET Core Web API 可以将 HTTP 请求发送到本地资源。 adding Hybrid Connections to the App Service(在“网络”下)使这成为可能。这很好用。

我添加了 integration tests 调用我的 API 端点。当我 运行 在 Azure DevOps 管道中进行这些测试时,显然这些本地资源不可用,因为没有涉及混合连接。

我可以将 WebApplicationFactory 配置为使用混合连接吗?

我最终 运行 自托管代理上的管道。然后我的本地资源可用。