Basically URL shortening is a functionality that can be added to any website. So definitely you can build a website with the URL shortening feature included and host it in the Azure App Services or in an Azure VM.
See the following sample, that can be deployed to Azure Subscription.
https://github.com/microsoft/AzUrlShortener
If you search the internet with the term URL shortening with ASP.Net Core, you may find tons of samples. If you prefer to use other technologies, change your search terms accordingly and you will find enough samples.
Hope this helps