Question: Managed identity, system assigned, sql database re

Can someone help me in knowing how to write terraform code to let resources like app services connect to the azure sql database using system assigned managed identity.