The solution is the following:
In the terraform documentation, https://registry.terraform.io/providers/hashicorp/azuread/latest/docs/resources/app_role_assignment I found out this
My terraform code is following:
I've tried it and it is working as expected.