AzureBot is an ASP.NET Core 2.2 implementation of the Slack Slash Command API, paired with Azure's Management Libraries service to allow Slack users to control Azure resources (at this time virtual machines) from Slack Slash Commands.
- /Azurebot help - Displays help message
- /Azurebot start [virtual machine name] - Starts the virtual machine
- /Azurebot stop [virtual machine name] - Stops the virtual machine
- /Azurebot restart [virtual machine name] - Restarts the virtual machine
- /Azurebot powerstate [virtual machine name] - Retrieves the virtual machine's power state
- Alias feature to allow control of multiple virtual machines with a single command
- Commands for additional Azure resources
- .NET Core 2.2
- Slack Team with administrative privileges
- Azure Subscription with administrative privileges
- Pull the latest code from the master branch of this repository
- Build and publish the application to your desired web server
- Web server must have .Net Core 2.2 Runtime installed
- Setup a new Slack App in the Slack API dashboard
- Update your application configuration file or secrets storage with your Slack Singing Secret from the App Credentials section of your new Slack App
- Add the Slash Command feature to your new Slack App
- Add a new Command with the following details:
- Command: /Azurebot
- Request URL: [Your Server URL]/api/SlashCommand
- Short Description: [Azure command]
- Usage Hint: [Azure command]
- Deploy your new Slack app to your Slack Team
- Obtain Azure credentials for your subscription and a service principal
- Update your application configuration file or secrets storage with your Azure Client Id, Client Secret and Tenant Id obtained in step 1
- Open Slack and invoke /Azurebot help
- Success!