Yes. I just did this yesterday with a user-assigned managed identity so that GitHub Actions could deploy an Azure Function.