Integrate The Mojifier with Slack
You've created all the required Azure Functions, and deployed them! Let's connect the Azure Functions with Slack and create a Slack slash command to calls the Azure Function and displays the resulting mojified image in the Slack window.
Create a Slack app
A slash command exists as part of a Slack app, also known as a Slack bot.
Choose an App Name and associate it with the Workspace you created at the start of this module, then select Create App.
Go to your Slack app and create a slash command. Select on the
slash Commandsmenu item.
Select Create New Command.
- Provide whatever name you want for your slash command in the command field.
- Enter the Azure function app public URL into the Request URL field. For our
mojifier-slack-function-appused in the previous unit, our function app public URL would be
/api/RespondToSlackCommandto the URL.
- Add a Short Description and Usage Hint.
If successful, you should see the slash command appear in your list of Slash Commands.
To get this working, you need to install the Slack app in the workspace. Select Basic Information in the menu.
Expand Install your app to your workspace and select Install app to workspace.
If asked, Authorize your app.
Try it out
You've created and connected your slash command to your deployed Azure Functions. Now, you can test it.
Open your Slack workspace.
Open a chat window and type
/mojify. If you named the app something else, enter that command instead.
If everything has worked correctly, you should see
mojifyas an option.
/mojifyand add an image URL.