
I recently learned that the name for an Azure Function App cannot be longer than 32 characters. Unfortunately, I learned this the hard way by spending about 24 hours trying to work out what was going on. What makes it worse is that Microsoft does document this here, albeit in a note towards the end of the page.
So, what happens if you name a Function App longer than 32 characters? The name gets truncated in the back end, and back-end services like storage use the truncated name.
Let’s take an example, I have four Function Apps with the following names:
ImportantApplication-Production-01
ImportantApplication-Production-02
ImportantApplication-Production-03
ImportantApplication-Production-04
The 32nd character in each of these names is the ‘-‘ near the end. This means every one of these gets truncated to “ImportantApplication-Production-” which means they lose the identifying number at the end, and all appear with the same name.
This causes all sorts of problems, particularly around accessing resources in storage accounts (assuming they are all using a shared storage account). I saw my apps failing to pick up messages from a storage queue, and managed dependencies seemed to take an incredibly long time to download or would stop part way and then try again after 5-10 minutes.