Class AzureWebsiteInstanceIdMachineIdentityProvider
Returns the machine identifier from the WEBSITE_INSTANCE_ID environment variable set by Azure App Service.
Inheritance
object
Namespace: Umbraco.Cms.Core.Factories
Assembly: Umbraco.Core.dll
Syntax
public class AzureWebsiteInstanceIdMachineIdentityProvider : IMachineIdentityProvider
Remarks
WEBSITE_INSTANCE_ID identifies the instance slot and remains stable across container recycles,
unlike Environment.MachineName which changes on every recycle on Azure App Service Linux.
Returns null when the environment variable is not present (i.e. outside Azure App Service).
Constructors
View SourceAzureWebsiteInstanceIdMachineIdentityProvider()
Declaration
public AzureWebsiteInstanceIdMachineIdentityProvider()
Fields
View SourceWebsiteInstanceIdEnvironmentVariable
The name of the Azure App Service environment variable that identifies the instance slot.
Declaration
public const string WebsiteInstanceIdEnvironmentVariable = "WEBSITE_INSTANCE_ID"
Field Value
| Type | Description |
|---|---|
| string |
Methods
View SourceGetMachineIdentifier()
Gets the machine identifier, or null if this provider does not apply.
Declaration
public string? GetMachineIdentifier()
Returns
| Type | Description |
|---|---|
| string |