0

我有一个现有的应用服务和一个现有的混合连接,我能够获得创建新的所需的所有参数,Pulumi.Azure.AppService.HybridConnection但 RelayId,

            var webApiHybridConnection = new HybridConnection(
                    hybridConnectionName,
                    new Pulumi.Azure.AppService.HybridConnectionArgs
                    {
                        AppServiceName = appServiceName,
                        ResourceGroupName = resourceGroupName,
                        RelayId = "how do I find this value?",
                        Hostname = "somehost01.com",
                        Port = 443,
                        SendKeyName = $"{_nameSet.AppServiceName(new ServiceName(ServiceName))}-sk",
                    });

如何使用 Pulumi.Azure 找到 RelayId,以便将混合连接分配给我的应用服务?

4

1 回答 1

1

我不熟悉 Azure 混合连接,但通过查看文档,我看到了一种Azure.Relay.HybridConnection资源类型,允许您创建中继混合连接以提供给 AppService 混合连接。

这是来自https://www.pulumi.com/docs/reference/pkg/azure/appservice/hybridconnection/#example-usage的示例片段:

var exampleHybridConnection = new Azure.Relay.HybridConnection("exampleHybridConnection", new Azure.Relay.HybridConnectionArgs
{
    ResourceGroupName = exampleResourceGroup.Name,
    RelayNamespaceName = exampleNamespace.Name,
    UserMetadata = "examplemetadata",
});
var exampleAppservice_hybridConnectionHybridConnection = new Azure.AppService.HybridConnection("exampleAppservice/hybridConnectionHybridConnection", new Azure.AppService.HybridConnectionArgs
{
    AppServiceName = exampleAppService.Name,
    ResourceGroupName = exampleResourceGroup.Name,

    /**
     * RelayId from `new Azure.Relay.HybridConnection(...)`
     */
    RelayId = exampleHybridConnection.Id,

    Hostname = "testhostname.example",
    Port = 8080,
    SendKeyName = "exampleSharedAccessKey",
});
于 2020-12-28T20:54:00.080 回答