Hi @Hussain Fakhruddin , thanks for providing more details.
Databases on Read replicas of Azure Database for MariaDB servers are created with read only option and they don't allow us to run any kind of ddl or insert/update/delete on them, even index creation is not allowed.
However, when we create the read replicas the indexes present on the primary server are synced with the read replicas. So if we want to create any new indexes, we first need to create them on the primary server which in turn will be synced to read-replicas.
Read replicas in Azure Database for MariaDB
Please let us know if this helps or else we can discuss further.
If answer is helpful please click on as it could help other members of the Microsoft Q&A community who have similar questions and are looking for solutions. Thank you for helping to improve Microsoft Q&A!