Hello @Mayank Malhotra
By default, Redis is only accessible from localhost. However, if you installed and not configured Redis /etc/redis/redis.conf
to allow connections from anywhere use following steps:
Open the Redis configuration file for editing:
sudo nano /etc/redis/redis.conf
Locate this line and make sure it is uncommented (remove the # if it exists):
/etc/redis/redis.conf
bind 127.0.0.1 ::1
Save and close the file when finished.
Then, restart the service to ensure that systemd reads your changes:
sudo systemctl restart redis
To check that this change has gone into effect, run the following netstat command:
sudo netstat -lnp | grep redis
Output
tcp 0 0 127.0.0.1:8447 0.0.0.0:* LISTEN 14222/redis-server
tcp6 0 0 ::1:8447 :::* LISTEN 14222/redis-server
After the above changes are applied you will need to open Redis port 8447 in Azure VM NSG.
Create an inbound security rule allowing traffic and assign values to the following settings:
- Destination port ranges: 8447
- Source port ranges: * (allows any source port)
- Priority value: Enter a value that is less than 65,500 and higher in priority than the default catch-all deny inbound rule.
https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-redis-on-ubuntu-20-04