Tip the rice into a bowl and cover with cold water. Set aside to soak while you prepare the veg.
Peel and thinly slice the onions. Trim, peel and dice the carrots. Warm a large pan or casserole dish for 2 mins over a medium heat. Add the onions and carrots with 2 tbsp oil and a pinch of salt. Pop a lid on the pan, turn the heat down to low and fry for 15 mins, stirring every so often, till the onions are soft and golden and the carrots are tender.
While the veg gently caramelise, trim and dice the courgettes to match the carrots. Peel and grate the garlic and ginger. Halve the chilli and finely chop it (for a milder flavour, you can scoop out the seeds and white pith, but this dish does benefit from a little chilli heat).
Stir the courgettes, garlic, ginger and chilli into the onion. Sizzle for 5 mins, stirring now and then, till the veg start to soften.
Stir in 2 tsp garam masala and drop in the cardamom pods and cinnamon stick. Stir in the tamarind paste. Add another good pinch of salt and a good grinding of black pepper.
Drain the rice and stir it into the pan. Pour in the coconut milk. Add 600ml boiling water and give everything a good stir to mix it well. Pop on the lid, turn up the heat and bring to the boil. Once the biriyani is boiling, turn the heat down and simmer for 12-15 mins till all the liquid has been absorbed and the rice is tender.
Take the biriyani off the heat and let it sit in the pan, lid on, for 5 mins to steam. This will finish cooking the rice and help make it fluffy.
T aste the biriyani and add a pinch more salt or pepper if you think it needs it. Fluff up the rice with a fork, then scoop the biriyani into warm bowls and serve.