Replying to Teams message in channel after a specific keyword posting - azure

Trying to understand what would be the right configuration to reply to a message when someone posts a specific keywords in a Teams channel.
Scenario:
Keyword is messaged to Teams channel
Logic App sends out a specific information from Dynatrace as the reply
This should be sort of switch statement because I want to be able to implement different scenarios and send out different configuration information from Dynatrace upon a specific keyword
What has been done:
logic app configuration 1
logic app configuration 2
The error message I am getting when Logic App has been triggered:
logic app execution error

Figured this out by actually assigning the keyword to a variable as a string and then switch statement is checking that keyword, and it did well for me.

Related

Logic App HTTP Request JSON from Azure Application Insights Alerting Notifications

I have a logic app setup following these directions to push it to a Teams Channel.
When the alert is notified it sends a message to my Teams channel successfully. However the objects are not parsing out like the example. I tried 2 things.
Copying step 4 (of the above documentation) into the sample payload to generate the schema.
After the Alert is triggered going into the Logic App run history and grabbing the raw outputs, copying those into the sample payload to generate the schema.
Used Common Alert Schema definitions for the payload and things still come in blank in Teams.
Neither of these options filled out the notification that was pushed to the teams channel.
I copied the raw outputs. Put them into PostMan. Sent the request to the endpoint. This worked when parsing the data into the message posted into the teams channel.
It's a simple logic app that is using the designer options:
"When an HTTP request is received" for the payload.
"Post a message with the flow bot to a channel" to post messages to a team channel.
What JSON payload or options should I be using for the ability to use a Logic App to push to a Teams Channel successfully?
I test it in my side, it works fine and I can reproduce your problem.
First I configure the alert to trigger the logic app, then go to "Runs history" of the logic app and find the outputs of the trigger(you mentioned you copied the raw into sample payload to generate the schema), copy the outputs body of raw but not all of the json content of raw (shown as below two screenshot)
After generate the schema, please select all of the parsed fields again because the expressions of the parsed fields which you selected before may not match the properties now (although it may not show error when you save the logic app if you don't select them again). Below screenshot is what I test, I selected all of the parsed fields again, then the logic app was executed as expected.

Slack slash command is not working in public channels unless manually added to them

I'm not sure how much detail to provide, but I'll try to put everything that I feel is relevant.
I have a slash command that I do some logic with through AWS Lambda and API Gateway. I'm using the python slackclient module and through that I'm sending messages back into slack with the WebClient. To clarify, I'm using the new bot token system Slack has come up with, not the classic bot one.
From my understanding, using a webhook to send messages in all channels in a workspace is very painful, as a webhook is provided per channel. Thus I'm using the WebClient to interface with Slack and send messages in public channels. The problem I'm facing is that unless I add my app to a channel, the command doesn't work. The Cloudwatch logs show me that the events are coming in just fine, as I see the event fine. I also see the following log by using sys.exc_info():
(<class 'slack.errors.SlackApiError'>, SlackApiError("The request to the Slack API failed.\nThe server responded with: {'ok': False, 'error': 'not_in_channel'}"), <traceback object at 0x7ff4a0dc32c0>)
Based on that, it looks to me like sending a message back into channels I've not added this app into doesn't seem to work, but I'm not sure what OAuth permissions/scopes would be needed for this. I've enabled the following scopes for the bot token:
channels:read
chat:write
commands
As per my understanding, I don't need to add any user scopes, since I want my app/bot itself to respond, and not respond on behalf of a user.
In short, my desired behaviour is to add this app to my workspace and immediately be have it reply to a slash command regardless of which public channel the slash command has been invoked from.
The current behaviour is that the app is able to get event data from all public channels when the slash command is invoked from any of them, yet it's unable to send messages in channels the command is invoked in unless it is in the channel.
Any help given would be much appreciated!
For people migrating apps from the deprecated :bot scope, the new scope is now ready.
Add chat:write.public to your Bot Token Scopes and the error not_in_channel will not be returned anymore for public channels.
Good news: with two special scopes, you can gain those abilities by asking for them explicitly. Request the chat:write.public scope and chat:write.customize scope, respectively, to gain the ability post in all public channels and adjust your app's message authorship.
https://api.slack.com/authentication/quickstart#public
I messaged Slack help, and it turns out this functionality isn't available with the new granular bot permissions yet. As per this Slack documentation:
Currently, your app must be a member of any channel it wishes to post messages to. To join a channel, request the channels:join scope and call the conversations.join method. However, apps will soon be able to post in any public channel, without gaining additional access to the channel, by requesting a new scope.
It looks like this won't be an issue when the functionality is added by Slack.

How to ensure my Google Home Assistant application is not rejected?

During our testing, we were unable to complete at least one of the behaviors or actions advertised by your app. Please make sure that a user can complete all core conversational flows listed in your registration information or recommended by your app.
Thank you for submitting your assistant app for review!
During testing, your app was unable to complete a function detailed in the app’s description. The reviewer interacted with the app by saying: “how many iphones were sold in the UK?” and app replied “I didn't get that. Can you try with other question?" and left conversation.
How can I resolve the above point to approve my Google Assistant action skills?
Without seeing the code in question or the intent you think should be handling this in Dialogflow, it is pretty difficult - but we can generalize.
It sounds like you have two issues:
Your fallback intent that generated the "I didn't get that" message is closing the conversation. This means that either the "close conversation" checkbox is checked in Dialogflow, you're using the app.tell() method when you should be using app.ask() instead, or the JSON you're sending back has close conversation set to true.
You don't have an intent to handle the question about how many iPhones were sold in the UK. This could be because you just don't list anything like that as a sample phrase, or the two parameters (the one for object type and the one for location) aren't using entity types that would match.
It means that somewhere, either in your app description or in a Dialogflow intent(they have full access to see what's in your intents) you hinted that “how many iphones were sold in the UK?” would be a valid question. Try changing the description/intents to properly match the restrictions of your app.

Searching for a way to programmatically receive messages with the ChatConnector

I am currently working with the Microsoft Bot Framework in NodeJS.
I am using a ChatConnector for receiving the input messages and here is my question:
Is there a way to let the connector receive a message programmatically?
The reason why I want this is a forwarding the last message in chat.
I need a line which fakes a user input in the chat.
Thanks for any suggestions.
For example the bot finished a dialog in "mainListen". As a result the user types for example "thanks and now do this". The input is in the message.text as a result available in the first "initStuff". Now i want to be able to use the message input as a input for the mainListen. At this point the user needs to tpye in the commands twice. The "mainListen" is for language understanding to lead into some other dialogs.

Send message to azure queue Microsoft.ServiceBus.Messaging.MessagingEntityNotFoundException

I'm trying to follow along with this tutorial https://azure.microsoft.com/en-us/documentation/articles/service-bus-dotnet-multi-tier-app-using-service-bus-queues/ on azure queues but I opted for using an MVC app instead of the web role. I have everything working up to step 9 of the create a web role where it says you should now be able to hit submit and watch the message count increase of your queue on page.
Instead I get An exception of type 'Microsoft.ServiceBus.Messaging.MessagingEntityNotFoundException' occurred in Microsoft.ServiceBus.dll but was not handled in user code
Additional information: 40400: Endpoint not found.
on the step 8 line when it send the message to the queue. It detects the queue as being there or it wouldn't skip over the check for is it created so I have to think it's some kind of access issue.
Can someone please assist me?
So funny enough I had all the code correct as per the tutorial but after checking the error definition metadata it says that entity not found usually means it can't find the queue. So as a shot in the dark I looked at this line
OrdersQueueClient = messagingFactory.CreateQueueClient(
"OrdersQueue");
and guessed that maybe the OrdersQueue was actually supposed to match the name of my queue which I overlooked during my first go through. So if you get entity not found make sure you check your connection string and queue name in the azure portal. Hope this is helpful.

Resources