In Microsoft Teams, it is required to create a resource account for auto-attendants and call queues to be able to route phone numbers or auto attendants to them. In the PBX world this would be considered an inbound rule/route.
Side Panel > Org-wide settings > Resource accounts
Display Name: name of queue or auto attendant
Username: we use the same as Displayname
@ your domain
Resource account type: Auto Attendant
or Call queue
Now that you have created your resource group, you need to assign a phone number. For direct routing, we will assign a phone number via PowerShell.
Follow this guide if you are unfamiliar with accessing PowerShell.
Set-CsOnlineApplicationInstance -Identity "user@example.com" -OnpremPhoneNumber "1NPANXXYYYY"
Change user@example.com
to the resource account user.
Change 1NPANXXYYYY
to the phone number you want assigned to your phone number.