poshbotio / PoshBot

Powershell-based bot framework
MIT License
537 stars 108 forks source link

ServiceBus connection string 'poshbot-teams_RootManageSharedAccessKey_SERVICEBUS' is missing or empty. #115

Closed oitptobbe closed 5 years ago

oitptobbe commented 5 years ago

Followed the guide https://poshbot.readthedocs.io/en/latest/guides/backends/setup-teams-backend/ And when I come to the test part I get "couldn't send, retry". So I opened the function apps log file for the teamswebhook and get

2018-09-17T07:31:58.196 [Info] Function started (Id=GUID) 2018-09-17T07:31:58.320 [Error] Exception while executing function: Functions.TeamsWebhook. Microsoft.Azure.WebJobs.ServiceBus: Microsoft Azure WebJobs SDK ServiceBus connection string 'poshbot-teams_RootManageSharedAccessKey_SERVICEBUS' is missing or empty. 2018-09-17T07:31:58.336 [Error] Function completed (Failure, Id=GUID, Duration=138ms)

So I tried clearing the SB_CONNECTION in the function app and then redid it but to no avail.

PS Azure:> $rootConnectionString = az servicebus namespace authorization-rule keys list -g MPN --namespace-name OITPGavleTeams -n RootManageSharedAccessKey --query primaryConnectionString --output tsv Azure:/ PS Azure:> az functionapp config appsettings set --resource-group MPN --name OITPGavleTeamFunction --settings "SB_CONNECTION = $rootConnectionString" [ { "name": "AzureWebJobsDashboard", "slotSetting": false, [………] }, { "name": "SB_CONNECTION", "slotSetting": false, "value": "Endpoint=sb://….servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey……" } ]

oitptobbe commented 5 years ago

When I went to the function -> TeamsWebHook->Integrate I had the option to select the service bus connection and then it worked.