I assume you are using Azure App Service (formerly known as Azure Websites).
To define your own environment variable, click to your site → All Settings → Application settings:
Add an app setting in the "App settings" section:
You can verify the value from the debug console.
Going to https://{your site name}.scm.azurewebsites.net/DebugConsole:
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…