Specify a routing rule for a scaleset behind a application gateway

I understand that I can specify an application gateway while creating scale sets using terraform. But how can one specify the routing rule for the scaleset?