This is a small code snippet demonstrating interacting with an Azure PAAS Redis Cache
import redis
import sys
redis_fqdn = ""
redis_key = ""
r = redis.StrictRedis(host=redis_fqdn, port=6380, password=redis_key, ssl=True)
# Test latency to redis
result = r.ping()
print(f"Ping response {str(result)}")
# Create an object in redis
r.set("OBJECT_KEY","OBJECT_VALUE")
# Create an object in redis with an expiration of 30seconds
r.set("OBJECT_KEY","OBJECT_VALUE",30)
# Get an object value from redis
val = r.get("OBJECT_KEY")
# Get an objects time to live (TTL)
ttl = r.ttl("OBJECT_KEY")