App Service Slot Deployed with Wrong Hostname

Kamoji, Koichiro J (KKAMOJI) 6 Reputation points
2022-03-02T00:49:41.543+00:00

App service slot keeps getting deployed with a hostname different than requested. Azure is adding random characters to the slot hostname.
For example, xxx-xx-xx-xx-stgb8e7.azurewebsites.net, the expected hostname is xxx-xx-xx-xx-stg.azurewebsites.net. The characyters "b8e7" are added by Azure.
This started happening after the slot was deleted and re-created.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,829 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Alistair Ross 7,101 Reputation points Microsoft Employee
    2023-01-31T15:22:03.34+00:00

    Hello

    This behaviour is expected as per our documentation

    "The slot's URL will be of the format http://sitename-slotname.azurewebsites.net. To keep the URL length within necessary DNS limits, the site name will be truncated at 40 characters, the slot name will be truncated at 19 characters, and an additional 4 random characters will be appended to ensure the resulting domain name is unique."

    https://learn.microsoft.com/en-us/azure/app-service/deploy-staging-slots#add-a-slot

    I hope this helps provide you with the information you need. If it does, please make sure to mark the question as answered so it helps other people in future.

    Kind regards

    Alistair