Preheat oven to 350 degrees. In a large frying pan melt margarine over medium heat. Add shallots and garlic and cook until tender, but not brown, about 2 minutes. Stir in chicken, rice, parsley, thyme, and salt and pepper to taste.
Seperate crescent rolls into 8 squares; seal line in each square. Divide chicken mixture evenly among squares; fold to make a triangle and seal edges. Prick tops of pastry with fork, and brush with egg. Bake on an ungreased baking sheet 15 minutes until golden brown. Remove to a serving platter and keep warm until ready to serve.