---
# System prepended metadata

title: Redis sercice for Bakcend App sercvice

---

# Redis sercice for Bakcend App sercvice

securely communicate the backend hosted on an Azure Web App instance with a redis service deployed on Kubernetes

## Consideretions

1. the Redis Service cannot be exposed to the internet in order to be secure
2. the backend must be able to connect to the redis service without changing the codebase of the backend

## Plan

1. create a Redis service in the DEV Kubernetes cluster with a cluster IP service to expose the service (inside the virtual network)
    like the SC-API broker service
2. enable `VNet integration` features in:
    brewdat-lh-appservice-backend-dev / Networking / Outbound Traffic
3. select the same DEV Kubernetes cluster subnet `aks-vnet-39581087` (Address space 10.0.0.0/8)
4. crete a new subnet call `backend-app-service-subnet` with the address space 10.241.0.0/16
    there is an existing kubernetes subnet subnet call `aks-subnet` with the address space 10.240.0.0/16
5. now app service is going to be able to call any deployed service in DEV Kubernetes (including our Redis service)
    we can test it here:
    
    5.1 open a backend app service console: 
    https://brewdat-lh-appservice-backend-dev.scm.azurewebsites.net/DebugConsole

    5.2 make a http request
    curl -s <protocol>://<redis-cluster-ip>

## Architecture
    
![](https://i.imgur.com/I4dGxby.png)

![](https://i.imgur.com/4ah9hV3.png)


## obstacle

1. Access to the Kubernetes networking config, a ticket was opened `RITM10744908`

## references

https://learn.microsoft.com/en-us/azure/app-service/overview-vnet-integration
https://blog.novanet.no/appservices-k8s-vnet-integration/