dnac2teams is a simple webhook receiver for Cisco DNA Center notifications, forwarding all notifications events to a Microsoft Teams incoming webhook.
DNAC notifications will be displayed as Adaptive Cards in MS Teams:
- Add an incoming webhook to a MS Teams team/space (howto)
- If using the preferred AWS/SAM installation method AWS CLI and AWS SAM CLI must be installed
- For the ASW/SAM and Docker installation methods, Docker must be installed
dnac2teams is using the AWS Serverless Application Model (Lambda+API-Gateway) and is best installed via SAM CLI.
- You must be logged in to AWS (via AWS CLI)
- You need either full admin permissions or sufficient permissions on the following services:
- Lambda
- API Gateway
- S3
- Cloud Formation
- IAM
- Clone the repo:
git clone https://github.com/spie-ics-ag/dnac2teams.git
- Go to your project folder:
cd dnac2teams
- Edit the
template.yaml
file - Change the global environment variables (line numbers 13/14) for the Teams incoming webhook URL and the authentication token:TEAMS_URL: https://company.webhook.office.com/webhookb2/webhookid AUTH_TOKEN: yoursupersecrettoken
- Build the SAM app
sam build --use-container
- Deploy the app
sam deploy --guided
Once deployed the public endpoint URL is displayed in the SAM output, use this URL and the token (specified in point 3) to create the webhook in DNAC.
For on-prem installations, there is a simple Flask-RESTX based receiver available.
Clone the repo:
git clone https://github.com/spie-ics-ag/dnac2teams.git
Go to your project folder:
cd dnac2teams
Deploy the app using docker or in a Python3 virtual environment
- Edit the
Dockerfile
file - Change the environment variables (line numbers 3/4) for the Teams incoming webhook URL and the authentication token:ENV TEAMS_URL=https://company.webhook.office.com/webhookb2/webhookid ENV AUTH_TOKEN=yoursupersecrettoken
- Build the container image:
docker build -t dnac2teams .
- Run the container:
docker run --rm -p 5000:5000 dnac2teams
- Create a virtual environment:
python3 -m venv .venv
- Activate your venv:
source .venv/bin/activate
- Install dependencies:
pip install pip --upgrade pip install -r requirements.txt
- Configure the webhook URL and the authentication token as environment variables:
export TEAMS_URL=https://company.webhook.office.com/webhookb2/webhookid export AUTH_TOKEN=yoursupersecrettoken
- Run the app:
cd dnac_to_teams python flaskapp.py
After starting either the Docker container or Python script, the webhook endpoint is available at http://localhost:5000/prod/dnac2teams. If you need a public endpoint, use ngrok
Setup the webhook: DNAC→System→Settings→External Services→Destinations→Webhook
Enter the URL from the SAM output (or the URL pointing to your local instance if you're running the on-prem version), use Token as the authentication method in DNAC, for the header value use the token specified in the AUTH_TOKEN environment variable.
You may test this app using the following DevNet sandboxes: