Azure
Learn how to deploy R2R into Azure
Deploying R2R on Azure
Azure provides a robust and scalable platform for deploying R2R (RAG to Riches). This guide will walk you through the process of setting up R2R on an Azure Virtual Machine, making it accessible both locally and publicly.
Overview
Deploying R2R on Azure involves the following main steps:
- Creating an Azure Virtual Machine
- Installing necessary dependencies
- Setting up R2R
- Configuring port forwarding for local access
- Exposing ports for public access (optional)
This guide assumes you have an Azure account and the necessary permissions to create and manage Virtual Machines.
Creating an Azure Virtual Machine
- Log in to the Azure Portal.
- Click on “Create a resource” and search for “Virtual Machine”.
- Choose
Ubuntu Server 22.04 LTS - x64 Gen2
as the operating system. - Select a VM size with at least 16GB of RAM, 4-8 vCPU cores, and 500GB of disk for a small-mid sized organization (< 5000 users). The
D4s_v3
series is a good starting point. - Configure networking settings to allow inbound traffic on ports
22
(SSH), and optionally7272
(R2R API). - Review and create the VM.
Exposing Ports for Public Access (Optional)
To make R2R publicly accessible:
-
Log in to the Azure Portal.
-
Navigate to your VM > Networking > Network Security Group.
-
Add a new inbound security rule:
- Destination port ranges: 7272
- Protocol: TCP
- Action: Allow
- Priority: 1000 (or lower than conflicting rules)
- Name: Allow_7272
-
Ensure R2R is configured to listen on all interfaces (0.0.0.0).
After starting your R2R application, users can access it at:
Installing Dependencies
SSH into your newly created VM with a command like ssh -i my_pem.pem azureuser@<your-vm-ip-address>
:
Now, run the following commands to install the necessary R2R dependencies:
Setting up R2R
- Serve your R2R backend
- Double check the health of the system
- Test ingesting and searching a sample document from a remote environment
Configuring Port Forwarding for Local Access
To access R2R from your local machine, use SSH port forwarding:
Replace <your-vm-ip-address>
with your Azure VM’s public IP address or DNS name. Note that in the R2R dashboard you will still need to use the remote VM address as requests are made from the client-side.
Security Considerations
- Use HTTPS (port 443) with a valid SSL certificate for production.
- Restrict source IP addresses in the security rule if possible.
- Regularly update and patch your system and applications.
- Monitor incoming traffic for suspicious activities.
- Remove or disable the rule when not needed for testing.
Conclusion
You have now successfully deployed R2R on Azure. The application should be accessible locally through SSH tunneling and optionally publicly through direct access to the Azure VM. Remember to configure authentication and implement proper security measures before exposing your R2R instance to the public internet.
For more information on configuring and using R2R, refer to the configuration documentation.