While developing a Slack Slash Command for one of the products I work on, I discovered it is rather difficult to allow external access to a Web API in my Visual Studio debugging environment. Using numerous online resources, this is the steps it took to make it all work:
- Setup a static IP for the router (or dynamic dns using something like noip.com)
- If not using dynamic DNS, create host record for the static IP (xxx.mydomain.com)
- Allow traffic through the windows firewall for the designated port
- Modified applicationhost.config (“.vs” sub-directory in the visual studio solution)
- Added bindings for the additional host names
- Execute a command to allow external access to the port
netsh http add urlacl url=http://<IP>:<PORT>/ user=everyone - Modified Web.config to not automatically re-direct to HTTPS (if the project is configured to force HTTPS, like mine was)
It would have been a lot easier, if Slack didn’t require using a URL with a host address, rather than a URL with a static IP.