-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how can we best get the DirectLine secret of a specific site in the DirectLine channel using an ARM template? #34829
Comments
Thanks for your comment. We are actively investigating and will get back to you shortly. Thanks for your patience. |
@hansmbakker - thanks for this question. You can use that function in a template with syntax like: Given that it is a list function, I don't know how you would limit it to one site. I don't see any parameters in the function that would allow you to limit it. I'll add this function to the list of available functions in a template. |
Great, I'll try it tomorrow! Thank you for your support! |
@tfitzmac I saw that it works when the site exists. The things that do not work yet are
Where can I best add feedback to the arm schema reference documentation? On https://docs.microsoft.com/en-us/azure/templates/microsoft.botservice/2018-07-12/botservices/channels there is no github feedback integration and the contributors link at the top links to a repository that is private, I believe. The azure-docs repo looks like the best alternative? "resources": [
{
"type": "Microsoft.BotService/botServices",
"apiVersion": "2017-12-01",
"name": "[parameters('botId')]",
"location": "global",
"sku": {
"name": "[parameters('sku')]"
},
"kind": "sdk",
"properties": {
"name": "[parameters('botId')]",
"displayName": "My Bot Name",
"endpoint": "[parameters('botMessagesEndpoint')]",
"msaAppId": "[parameters('appId')]",
"developerAppInsightsApplicationId": "[parameters('insightsAccountName')]",
"developerAppInsightKey": "[reference(resourceId('microsoft.insights/components/', parameters('insightsAccountName')), '2015-05-01').InstrumentationKey]"
},
"resources": [
{
"name": "DirectLineChannel",
"apiVersion": "2018-07-12",
"location": "global",
"type": "channels",
"dependsOn": [
"[resourceId('Microsoft.BotService/botServices', parameters('botId'))]"
],
"properties": {
"channelName": "DirectLineChannel",
"sites": [
{
"siteName": "TokenGeneration",
"isEnabled": true,
"isV1Enabled": true,
"isV3Enabled": true,
"isSecureSiteEnabled": true,
"isBlockUserUploadEnabled": true,
"trustedOrigins": "[parameters('trustedOrigins')]"
}
]
}
}
]
} I fill the trustedOrigins parameter with an array containing one string of a the base url of my bot. The output works if I write it like this, and if the site got created (otherwise "outputs": {
"directLineSecret": {
"type": "string",
"value": "[listChannelWithKeys(concat(resourceId('Microsoft.BotService/botServices', parameters('botId')), '/channels/DirectLineChannel'), '2018-07-12').properties.properties.sites[0].key]"
}
} |
By the way, you can take the resource id directly by setting up the segment:
as in this post explains Azure/azure-quickstart-templates#1965 |
I believe the reference docs have been updated with the required information. |
Main question: how can we best get the DirectLine secret of a specific site in the DirectLine channel using an ARM template?
I found the
listChannelWithKeys
function. This is a semi-documented function on the Microsoft.Bot/botservice/channels provider.It is listed in Azure Resource explorer on the Actions tab of a channel and it is explained in this stackoverflow answer, but it is not in the ARM template reference.
However Visual Studio code does not recognize it as a function to be used in ARM templates. Furthermore, the
listChannelWithKeys
returns the properties of all sites in the requested channel, while I want the secret for a specific site.I would hope to be able to do something like this:
How can I best do that?
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: