Sending data from Arduino Mega 2560 to ESP32 to send the data to Cloud (Azure)

Hi guys

I am having a hard time figuring out if I could send the sensor data from Arduino Mega 2560 to ESP32 with some sort of connection like UART, in order to send the data to the cloud.

The ESP32 has some IO pins. ESP32 Pinout Reference: Which GPIO pins should you use? | Random Nerd Tutorials