redis connection error when trying to connect to SSL port 6380 of azure redis to Azure app service

R Aishwarya 65 Reputation points
2023-12-05T07:18:22.7866667+00:00

Hi,

I m trying to connect azure app service to azure redis cache using port 6380, the configuration works fine with 6379 port , but when I try to switch port to 6380 , azure app service log stream says redis connection timed out error.

At Azure redis cache I have changed port to SSL 6380 and in app configuration I have changed the port. but still Application is down ever since 6380 port is set.

below are the logs of app service.

2023-12-05T07:07:10.843304678Z fail: Middleware[0]

2023-12-05T07:07:10.843490689Z Failed to forward request to http://169.254.132.4:3000. Encountered a System.Threading.Tasks.TaskCanceledException exception after 300001.731ms with message: The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing.. Check application logs to verify the application is properly handling HTTP traffic.

2023-12-05T07:08:23.591413290Z "++++++++++++++++++++++++++++++++++++++++"

2023-12-05T07:08:23.591465690Z "/"

2023-12-05T07:07:10.867648272Z fail: Middleware[0]

2023-12-05T07:07:10.867811473Z Failed to forward request to http://169.254.130.3:3000. Encountered a System.Threading.Tasks.TaskCanceledException exception after 300007.371ms with message: The request was canceled due to the configured HttpClient.Timeout of 300 seconds elapsing.. Check application logs to verify the application is properly handling HTTP traffic.

2023-12-05T07:10:37 No new trace in the past 1 min(s).

Below are the Application logs.

[fa896900-b462-4efd-9c09-9017ce4b65f7F, [2023-11-28T10:33:59.169712 #30] FATAL -- : [6ebfc8ce-252d-461f-8f5d-58ddaa029395]   
[6ebfc8ce-252d-461f-8f5d-58ddaa029395] Redis::TimeoutError (Connection timed out):
[6ebfc8ce-252d-461f-8f5d-58ddaa029395]   
[6ebfc8ce-252d-461f-8f5d-58ddaa029395] redis (4.0.3) lib/redis/connection/ruby.rb:71:in `rescue in _read_from_socket'
[6ebfc8ce-252d-461f-8f5d-58ddaa029395] redis (4.0.3) lib/redis/cE, [2023-11-28T10:34:55.405985 #29] ERROR -- : [b22bf08b-2115-4d33-ab91-76e752d9ce80]   Couldn't find template for digesting: illegibles/illegible
E, [2023-11-28T10:34:55.418655 #29] ERROR -- : [b22bf08b-2115-4d33-ab91-76e752d9ce80]   Couldn't find template for digesting: yous/you
E, [2023-11-28T10:34:55.444716 #29] ERROR -- : [b22bf08b-2115-4d33-ab91-76e752d9ce80]   Couldn't find template for digesting: anies/any
F, [2023-11-28T10:35:32.705826 #29] FATAL -- : [ad1f1e9b-cf27-44af-a0d6-2a909496663f]   
[ad1f1e9b-cf27-44af-a0d6-2a909496663f] Redis::TimeoutError (Connection timed out):
[ad1f1e9b-cf27-44af-a0d6-2a909496663f]   
[ad1f1e9b-cf27-44af-a0d6-2a909496663f] redis (4.0.3) lib/redis/connection/ruby.rb:71:in `rescue in _read_from_socket'
[ad1f1e9b-cf27-44af-a0d6-2a909496663f] redis (4.0.3) lib/redis/connection/ruby.rb:64:in `_read_from_socket'

Also We are using docker container for redis , also changed the container port to 6380

User's image

Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
221 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,047 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. brtrach-MSFT 15,356 Reputation points Microsoft Employee
    2023-12-08T04:50:40.38+00:00

    @R Aishwarya It seems like you are having trouble connecting your Azure App Service to Azure Cache for Redis using port 6380. Have you checked the private endpoint configuration and firewall rules for your Azure Cache for Redis instance?

    Can you try the below troubleshooting steps?

    Verify that your private endpoint configuration is correct. Make sure that the Public Network Access flag is disabled and that your private endpoint is configured correctly. You can find this setting under Private Endpoint in the Resource menu on the left in the Azure portal.

    Check your firewall rules. If you have a firewall configured for your Azure Cache for Redis, ensure that your client IP address is added to the firewall rules. You can check Firewall on the Resource menu under Settings on the Azure portal.

    Verify that your application is connecting to <cachename>.redis.cache.windows.net on port 6380. We recommend avoiding the use of <cachename>.privatelink.redis.cache.windows.net in the configuration or the connection string.

    Run a command like nslookup <hostname> from within the VNet that is linked to the private endpoint to verify that the command resolves to the private IP address for the cache.