How can I get the "real" Azure App Service slot instance name?
The answer hiding right under my nose - and different terminology.
What I was calling a "slot instance name" is actually referred to as a "Deployment Id" (I know this is an overloaded term as it's also used in the context of Azure's (now legacy) "Cloud Services" PaaS too).
This information is visible in the Kudu environment page and is also an exposed as an environment-variable: WEBSITE_DEPLOYMENT_ID
.
The WEBSITE_DEPLOYMENT_ID
value is of the form {SiteName}[__{Random}]
, with the __{Random}
prefix omitted for the first deployment space.
If you look closely at the screenshot I posted, you'll notice the left-hand screenshot has the site-slot-name Site1__e928
whereas the right-hand screenshot is of the "first" slot-space and so its name is just Site1
.
It is unfortunate that this information is not documented by Microsoft publicly - at least so far as Google can see (searching for the term right now yields zero useful relevant results):
Mystery solved!