在二头肌中获取机器人服务直线密钥?

问题描述 投票:0回答:1

如何使用二头肌获取机器人服务的 DirectLine 密钥?

我有一个二头肌,它创建机器人服务,然后创建应用程序服务。 我需要将直线键添加为应用程序服务中的应用程序设置值。我找不到从我的二头肌中的机器人资源中获取密钥的方法。

我看到一些帖子表明我可以通过 CLI 或 http 调用获取密钥,但是当我用二头肌构建所有内容时,这似乎很复杂。 我可能忽略了一些简单的事情?

azure-bot-service azure-bicep
1个回答
0
投票

您可以使用

listChannelWithKeys()
检索密钥:

param botServiceName string

// reference to bot service
resource botService 'Microsoft.BotService/botServices@2023-09-15-preview' existing = {
  name: botServiceName
}


// reference to bot service channel
resource directLineChannel 'Microsoft.BotService/botServices/channels@2023-09-15-preview' existing = {
  parent: botService
  name: 'DirectLineChannel'
}

// DO NOT USE OUTPUT in real world
output directLine object = directLineChannel.listChannelWithKeys()
© www.soinside.com 2019 - 2024. All rights reserved.