Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
App on Azure or local check
using Microsoft.Azure.WebJobs;
using System;
namespace MyFunction.Extensions
{
public static class ExecutionContextExtension
{
public static bool IsAzureEnvironment(this ExecutionContext context, string environmentVariable = "WEBSITE_INSTANCE_ID")
{
var isAzureEnvironment = !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(environmentVariable, EnvironmentVariableTarget.Process));
return isAzureEnvironment;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.