First enable the system assigned identity in configuration stores resource:
"identity": {
"type": "SystemAssigned"
}
Then better to declare a variable and get the subscription resource id by providing role definition id that you can find by going to Add role assignment screen in IAM for your app configuration service in azure portal:

"roleAppConfigDataReader": "[subscriptionResourceId('Microsoft.Authorization/roleDefinitions', <Your role definition id for AppConfigDataReader>)]"
Then you will include it in the configuration stores resource's json:
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2018-01-01-preview",
"scope": "[format('Microsoft.AppConfiguration/configurationStores/{0}', <YourConfigStoreName>)]",
"name": "[guid(resourceId('Microsoft.Web/sites', <YourAppServiceName>)), resourceId('Microsoft.AppConfiguration/configurationStores', <YourConfigStoreName>), variables('roleAppConfigDataReader'))]",
"properties": {
"roleDefinitionId": "[variables('roleAppConfigDataReader')]",
"principalId": "[reference(resourceId('Microsoft.Web/sites', <YourAppServiceName>), '2021-02-01', 'full').identity.principalId]"
},
"dependsOn": [
"[resourceId('Microsoft.AppConfiguration/configurationStores', <YourConfigStoreName>)]"
]
}
Please take help from the samples Microsoft provides from this link:
https://docs.microsoft.com/en-us/samples/browse/?expanded=azure&products=azure-resource-manager