├── .gitattributes ├── script ├── count.ps1 ├── restore.ps1 ├── install.ps1 ├── clean.ps1 ├── build.ps1 ├── release.ps1 └── test.ps1 ├── test.cmd ├── sample ├── KeyVaultFunctionSample │ ├── host.json │ ├── KeyVaultFunctionSample.csproj │ ├── KeyVaultFunction.cs │ └── .gitignore ├── AutofacFunctionSample │ ├── host.json │ ├── local.settings.json │ ├── DependencyInjectionConfig.cs │ ├── AutofacFunctionSample.csproj │ ├── InjectedFunction.cs │ └── .gitignore ├── RedisFunctionSample │ ├── host.json │ ├── RedisFunctionSample.csproj │ ├── TestFunction.cs │ ├── RedisFunction.cs │ └── .gitignore ├── UnityFunctionSample │ ├── host.json │ ├── local.settings.json │ ├── DependencyInjectionConfig.cs │ ├── UnityFunctionSample.csproj │ ├── InjectedFunction.cs │ └── .gitignore ├── InjectionFunctionSample │ ├── host.json │ ├── local.settings.json │ ├── Startup.cs │ ├── InjectionFunctionSample.csproj │ ├── InjectedFunction.cs │ └── .gitignore ├── ConfigurationFunctionSample │ ├── host.json │ ├── local.settings.json │ ├── ConfigurationFunctionSample.csproj │ ├── ConfigFunction.cs │ └── .gitignore └── Sample.Storage │ ├── Sample.Storage.csproj │ ├── ICacheConfigProvider.cs │ ├── ITableAccess.cs │ ├── IStorageAccess.cs │ └── ICache.cs ├── test ├── Indigo.Functions.Injection.IntegrationTests │ ├── test.json │ ├── Config.cs │ ├── Indigo.Functions.Injection.IntegrationTests.csproj │ └── InjectAttributeTests.cs ├── Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget │ ├── host.json │ ├── local.settings.json │ ├── IDependency.cs │ ├── DependencyConfig.cs │ ├── Function.cs │ ├── Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget.csproj │ └── .gitignore ├── Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget │ ├── host.json │ ├── IDependency.cs │ ├── DependencyConfig.cs │ ├── Function.cs │ ├── Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget.csproj │ └── .gitignore ├── Indigo.Functions.Redis.IntegrationTests.Target │ ├── host.json │ ├── CustomObject.cs │ ├── local.settings.json │ ├── Indigo.Functions.Redis.IntegrationTests.Target.csproj │ ├── ResourceFunction.cs │ ├── DatabaseFunction.cs │ ├── StringFunction.cs │ ├── MultiplexerFunction.cs │ ├── PocoFunction.cs │ └── .gitignore ├── Indigo.Functions.Unity.IntegrationTests.Target │ ├── host.json │ ├── IDependency.cs │ ├── local.settings.json │ ├── DependencyConfig.cs │ ├── ValueProvider.cs │ ├── ILoggingDependency.cs │ ├── Indigo.Functions.Unity.IntegrationTests.Target.csproj │ ├── Function.cs │ └── .gitignore ├── Indigo.Functions.Autofac.IntegrationTests.Target │ ├── host.json │ ├── IDependency.cs │ ├── local.settings.json │ ├── ValueProvider.cs │ ├── DependencyConfig.cs │ ├── ILoggingDependency.cs │ ├── Indigo.Functions.Autofac.IntegrationTests.Target.csproj │ ├── Function.cs │ └── .gitignore ├── Indigo.Functions.Injection.IntegrationTests.Target │ ├── host.json │ ├── IDependency.cs │ ├── local.settings.json │ ├── ValueProvider.cs │ ├── ILoggingDependency.cs │ ├── Startup.cs │ ├── Indigo.Functions.Injection.IntegrationTests.Target.csproj │ ├── Function.cs │ └── .gitignore ├── Indigo.Functions.Configuration.IntegrationTests.Target │ ├── host.json │ ├── Indigo.Functions.Configuration.IntegrationTests.Target.csproj │ ├── local.settings.json │ ├── .gitignore │ └── Function.cs ├── Indigo.Functions.Configuration.IntegrationTests │ ├── Indigo.Functions.Configuration.IntegrationTests.csproj │ └── ConfigAttributeTests.cs └── Indigo.Functions.Redis.IntegrationTests │ ├── Indigo.Functions.Redis.IntegrationTests.csproj │ └── RedisAttributeTests.cs ├── src ├── Indigo.Functions.Autofac │ ├── Internal │ │ └── Anonymous.cs │ ├── IDependencyConfig.cs │ ├── InjectAttribute.cs │ ├── InjectConverter.cs │ ├── Indigo.Functions.Autofac.csproj │ └── InjectExtension.cs ├── Indigo.Functions.Unity │ ├── Internal │ │ └── Anonymous.cs │ ├── IDependencyConfig.cs │ ├── InjectAttribute.cs │ ├── InjectConverter.cs │ ├── Indigo.Functions.Unity.csproj │ └── InjectExtension.cs ├── Indigo.Functions.Injection │ ├── Internal │ │ └── Anonymous.cs │ ├── InjectAttribute.cs │ ├── Startup.cs │ ├── InjectConverter.cs │ ├── InjectExtension.cs │ └── Indigo.Functions.Injection.csproj ├── Indigo.Functions.Redis │ ├── StringConverter.cs │ ├── RedisAttribute.cs │ ├── PocoOpenType.cs │ ├── PocoConverter.cs │ ├── RedisAsyncCollector.cs │ ├── Indigo.Functions.Redis.csproj │ └── RedisExtension.cs ├── Indigo.Functions.KeyVault │ ├── Indigo.Functions.KeyVault.csproj │ ├── SecretAttribute.cs │ └── KeyVaultExtension.cs └── Indigo.Functions.Configuration │ ├── ConfigAttribute.cs │ ├── Indigo.Functions.Configuration.csproj │ └── ConfigExtension.cs ├── LICENSE.md ├── .gitignore └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | -------------------------------------------------------------------------------- /script/count.ps1: -------------------------------------------------------------------------------- 1 | cloc . --vcs=git 2 | -------------------------------------------------------------------------------- /test.cmd: -------------------------------------------------------------------------------- 1 | powershell .\script\test.ps1 2 | -------------------------------------------------------------------------------- /sample/KeyVaultFunctionSample/host.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /sample/AutofacFunctionSample/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /sample/RedisFunctionSample/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /sample/UnityFunctionSample/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /sample/InjectionFunctionSample/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /sample/ConfigurationFunctionSample/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0" 3 | } -------------------------------------------------------------------------------- /script/restore.ps1: -------------------------------------------------------------------------------- 1 | nuget restore .\Indigo.Functions.sln -OutputDirectory ..\packages -Verbosity quiet 2 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests/test.json: -------------------------------------------------------------------------------- 1 | { 2 | "TestTargetUri": "http://localhost:7072/test" 3 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "http": { 3 | "routePrefix": "test" 4 | } 5 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "http": { 3 | "routePrefix": "test" 4 | } 5 | } -------------------------------------------------------------------------------- /script/install.ps1: -------------------------------------------------------------------------------- 1 | npm i -g azure-functions-core-tools@core --unsafe-perm true 2 | npm install -g redis-cli 3 | npm install -g redis-server 4 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "http": { 4 | "routePrefix": "test" 5 | } 6 | }, 7 | "version": "2.0" 8 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "http": { 4 | "routePrefix": "test" 5 | } 6 | }, 7 | "version": "2.0" 8 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "http": { 4 | "routePrefix": "test" 5 | } 6 | }, 7 | "version": "2.0" 8 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "http": { 4 | "routePrefix": "test" 5 | } 6 | }, 7 | "version": "2.0" 8 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Configuration.IntegrationTests.Target/host.json: -------------------------------------------------------------------------------- 1 | { 2 | "extensions": { 3 | "http": { 4 | "routePrefix": "test" 5 | } 6 | }, 7 | "version": "2.0" 8 | } -------------------------------------------------------------------------------- /script/clean.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [string]$rootPath 3 | ) 4 | 5 | $allTests = Get-ChildItem $rootPath -Recurse -Filter "*Tests.dll" 6 | foreach ($assembly in $allTests) { 7 | Remove-Item $assembly.FullName 8 | } 9 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Autofac/Internal/Anonymous.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Autofac.Internal 2 | { 3 | public sealed class Anonymous 4 | { 5 | private Anonymous() 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Unity/Internal/Anonymous.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Unity.Internal 2 | { 3 | public sealed class Anonymous 4 | { 5 | private Anonymous() 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Injection/Internal/Anonymous.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Injection.Internal 2 | { 3 | public sealed class Anonymous 4 | { 5 | private Anonymous() 6 | { 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Unity/IDependencyConfig.cs: -------------------------------------------------------------------------------- 1 | using Unity; 2 | 3 | namespace Indigo.Functions.Unity 4 | { 5 | public interface IDependencyConfig 6 | { 7 | void RegisterComponents(UnityContainer container); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Autofac/IDependencyConfig.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | 3 | namespace Indigo.Functions.Autofac 4 | { 5 | public interface IDependencyConfig 6 | { 7 | void RegisterComponents(ContainerBuilder builder); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/IDependency.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Unity.IntegrationTests.Target 2 | { 3 | public interface IDependency 4 | { 5 | } 6 | 7 | public class DependencyImpl : IDependency 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true" 6 | } 7 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/IDependency.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Autofac.IntegrationTests.Target 2 | { 3 | public interface IDependency 4 | { 5 | } 6 | 7 | public class DependencyImpl : IDependency 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/IDependency.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Injection.IntegrationTests.Target 2 | { 3 | public interface IDependency 4 | { 5 | } 6 | 7 | public class DependencyImpl : IDependency 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget/IDependency.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget 2 | { 3 | public interface IDependency 4 | { 5 | } 6 | 7 | public class DependencyImpl : IDependency 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget/IDependency.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget 2 | { 3 | public interface IDependency 4 | { 5 | } 6 | 7 | public class DependencyImpl : IDependency 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Unity/InjectAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Description; 2 | using System; 3 | 4 | namespace Indigo.Functions.Unity 5 | { 6 | [Binding] 7 | [AttributeUsage(AttributeTargets.Parameter)] 8 | public class InjectAttribute : Attribute 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/CustomObject.cs: -------------------------------------------------------------------------------- 1 | namespace Indigo.Functions.Redis.IntegrationTests.Target 2 | { 3 | public class CustomObject 4 | { 5 | public int IntegerProperty { get; set; } 6 | 7 | public string StringProperty { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Autofac/InjectAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Description; 2 | using System; 3 | 4 | namespace Indigo.Functions.Autofac 5 | { 6 | [Binding] 7 | [AttributeUsage(AttributeTargets.Parameter)] 8 | public class InjectAttribute : Attribute 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "setting1": "value1", 7 | "setting2": "value2" 8 | } 9 | } -------------------------------------------------------------------------------- /src/Indigo.Functions.Injection/InjectAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Description; 2 | using System; 3 | 4 | namespace Indigo.Functions.Injection 5 | { 6 | [Binding] 7 | [AttributeUsage(AttributeTargets.Parameter)] 8 | public class InjectAttribute : Attribute 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sample/AutofacFunctionSample/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "cache_size": "10", 7 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 8 | }, 9 | "ConnectionStrings": {} 10 | } -------------------------------------------------------------------------------- /sample/UnityFunctionSample/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "cache_size": "10", 7 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 8 | }, 9 | "ConnectionStrings": {} 10 | } -------------------------------------------------------------------------------- /sample/InjectionFunctionSample/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "cache_size": "10", 7 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 8 | }, 9 | "ConnectionStrings": {} 10 | } -------------------------------------------------------------------------------- /sample/ConfigurationFunctionSample/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "test1": "testvalue1", 7 | "test3": "testvalue3", 8 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 9 | }, 10 | "ConnectionStrings": {} 11 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "RedisConfigurationOptions": "localhost", 7 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 8 | }, 9 | "ConnectionStrings": {} 10 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "setting1": "value1", 7 | "setting2": "value2", 8 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 9 | }, 10 | "ConnectionStrings": {} 11 | } -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "setting1": "value1", 7 | "setting2": "value2", 8 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 9 | }, 10 | "ConnectionStrings": {} 11 | } -------------------------------------------------------------------------------- /sample/Sample.Storage/Sample.Storage.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget/DependencyConfig.cs: -------------------------------------------------------------------------------- 1 | using Unity; 2 | 3 | namespace Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget 4 | { 5 | internal class DependencyConfig : IDependencyConfig 6 | { 7 | public void RegisterComponents(UnityContainer container) 8 | { 9 | container.RegisterType(); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Configuration.IntegrationTests/Indigo.Functions.Configuration.IntegrationTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget/DependencyConfig.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | 3 | namespace Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget 4 | { 5 | internal class DependencyConfig : IDependencyConfig 6 | { 7 | public void RegisterComponents(ContainerBuilder builder) 8 | { 9 | builder.RegisterType() 10 | .As(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Redis/StringConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs; 2 | using Newtonsoft.Json; 3 | 4 | namespace Indigo.Functions.Redis 5 | { 6 | public class StringConverter : IConverter 7 | { 8 | public string Convert(T input) 9 | { 10 | if (input == null) 11 | { 12 | return null; 13 | } 14 | return JsonConvert.SerializeObject(input); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/DependencyConfig.cs: -------------------------------------------------------------------------------- 1 | using Unity; 2 | 3 | namespace Indigo.Functions.Unity.IntegrationTests.Target 4 | { 5 | public class DependencyConfig : IDependencyConfig 6 | { 7 | public void RegisterComponents(UnityContainer container) 8 | { 9 | container.RegisterType(); 10 | container.RegisterType(); 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Indigo.Functions.KeyVault/Indigo.Functions.KeyVault.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Injection/Startup.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Injection; 2 | using Microsoft.Azure.WebJobs; 3 | using Microsoft.Azure.WebJobs.Hosting; 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | [assembly: WebJobsStartup(typeof(Startup))] 7 | namespace Indigo.Functions.Injection 8 | { 9 | public class Startup : IWebJobsStartup 10 | { 11 | public void Configure(IWebJobsBuilder builder) 12 | { 13 | builder.Services.AddSingleton(builder.Services); 14 | builder.AddExtension(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Indigo.Functions.KeyVault/SecretAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Description; 2 | using System; 3 | 4 | namespace Indigo.Functions.KeyVault 5 | { 6 | [Binding] 7 | [AttributeUsage(AttributeTargets.Parameter)] 8 | public class SecretAttribute : Attribute 9 | { 10 | [AppSetting(Default = "KeyVaultClientId")] 11 | public string ClientId { get; set; } 12 | 13 | [AppSetting(Default = "KeyVaultClientSecret")] 14 | public string ClientSecret { get; set; } 15 | 16 | public string SecretIdentifier { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/ValueProvider.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace Indigo.Functions.Unity.IntegrationTests.Target 4 | { 5 | public class ValueProvider 6 | { 7 | private readonly IConfiguration _configuration; 8 | 9 | public ValueProvider(IConfiguration configuration) 10 | { 11 | _configuration = configuration; 12 | } 13 | 14 | public string GetSettingValue(string settingName) 15 | { 16 | return _configuration[settingName]; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/ValueProvider.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace Indigo.Functions.Autofac.IntegrationTests.Target 4 | { 5 | public class ValueProvider 6 | { 7 | private readonly IConfiguration _configuration; 8 | 9 | public ValueProvider(IConfiguration configuration) 10 | { 11 | _configuration = configuration; 12 | } 13 | 14 | public string GetSettingValue(string settingName) 15 | { 16 | return _configuration[settingName]; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/ValueProvider.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace Indigo.Functions.Injection.IntegrationTests.Target 4 | { 5 | public class ValueProvider 6 | { 7 | private readonly IConfiguration _configuration; 8 | 9 | public ValueProvider(IConfiguration configuration) 10 | { 11 | _configuration = configuration; 12 | } 13 | 14 | public string GetSettingValue(string settingName) 15 | { 16 | return _configuration[settingName]; 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/DependencyConfig.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | 3 | namespace Indigo.Functions.Autofac.IntegrationTests.Target 4 | { 5 | public class DependencyConfig : IDependencyConfig 6 | { 7 | public void RegisterComponents(ContainerBuilder builder) 8 | { 9 | builder.RegisterType() 10 | .As(); 11 | builder.RegisterType() 12 | .As(); 13 | builder.RegisterType(); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests/Config.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace Indigo.Functions.Injection.IntegrationTests 4 | { 5 | internal class Config 6 | { 7 | private readonly IConfigurationRoot _config; 8 | 9 | public Config() 10 | { 11 | _config = new ConfigurationBuilder() 12 | .AddJsonFile("test.json") 13 | .Build(); 14 | } 15 | 16 | public string MisconfiguredTargetUrl => _config["TestMisconfiguredTargetUri"]; 17 | 18 | public string TargetUrl => _config["TestTargetUri"]; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Injection/InjectConverter.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Injection.Internal; 2 | using Microsoft.Azure.WebJobs; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Indigo.Functions.Injection 6 | { 7 | public class InjectConverter : IConverter 8 | { 9 | private readonly ServiceProvider _provider; 10 | 11 | public InjectConverter(ServiceProvider provider) 12 | { 13 | _provider = provider; 14 | } 15 | 16 | public T Convert(Anonymous input) 17 | { 18 | return _provider.GetService(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Redis/RedisAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Description; 2 | using System; 3 | 4 | namespace Indigo.Functions.Redis 5 | { 6 | [Binding] 7 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue)] 8 | public class RedisAttribute : Attribute 9 | { 10 | /// 11 | /// Allows Redis config to be defined in app settings 12 | /// 13 | [AppSetting(Default = "RedisConfigurationOptions")] 14 | public string Configuration { get; set; } 15 | 16 | [AutoResolve] 17 | public string Key { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sample/UnityFunctionSample/DependencyInjectionConfig.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Unity; 2 | using Sample.Storage; 3 | using Unity; 4 | 5 | namespace UnityFunctionSample 6 | { 7 | public class DependencyInjectionConfig : IDependencyConfig 8 | { 9 | public void RegisterComponents(UnityContainer container) 10 | { 11 | container.RegisterSingleton(); 12 | container.RegisterType(); 13 | container.RegisterType(); 14 | container.RegisterType(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Redis/PocoOpenType.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs; 2 | using Microsoft.Azure.WebJobs.Host.Bindings; 3 | using StackExchange.Redis; 4 | using System; 5 | 6 | namespace Indigo.Functions.Redis 7 | { 8 | public class PocoOpenType : OpenType 9 | { 10 | public override bool IsMatch(Type type, OpenTypeMatchContext context) 11 | { 12 | return type != typeof(IConnectionMultiplexer) 13 | && type != typeof(IDatabase) 14 | && type != typeof(string) 15 | && (!type.IsGenericType || type.GetGenericTypeDefinition() != typeof(IAsyncCollector<>)); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /sample/Sample.Storage/ICacheConfigProvider.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | 3 | namespace Sample.Storage 4 | { 5 | public interface ICacheConfigProvider 6 | { 7 | int GetCacheSize(); 8 | } 9 | 10 | public class CacheConfigProvider : ICacheConfigProvider 11 | { 12 | private readonly IConfiguration _configuration; 13 | 14 | public CacheConfigProvider(IConfiguration configuration) 15 | { 16 | _configuration = configuration; 17 | } 18 | 19 | public int GetCacheSize() 20 | { 21 | return int.Parse(_configuration["cache_size"]); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /script/build.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [string]$rootPath 3 | ) 4 | 5 | Write-Host "Running restore" -ForegroundColor Blue 6 | 7 | . $PsScriptRoot\restore.ps1 8 | 9 | if ($LastExitCode -ne 0) { 10 | return $LastExitCode 11 | } 12 | 13 | Write-Host "Running build" -ForegroundColor Blue 14 | 15 | dotnet msbuild .\Indigo.Functions.sln '/consoleLoggerParameters:Summary;Verbosity=minimal' /m /t:Rebuild /nologo /p:TreatWarningsAsErrors=true 16 | 17 | if ($LastExitCode -ne 0) { 18 | return $LastExitCode 19 | } 20 | 21 | Write-Host "Running test" -ForegroundColor Blue 22 | 23 | . $PsScriptRoot\test.ps1 24 | 25 | if ($LastExitCode -ne 0) { 26 | return $LastExitCode 27 | } 28 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/ILoggingDependency.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | 3 | namespace Indigo.Functions.Unity.IntegrationTests.Target 4 | { 5 | public interface ILoggingDependency 6 | { 7 | void Log(string message); 8 | } 9 | 10 | public class LoggingDependencyImpl : ILoggingDependency 11 | { 12 | private readonly ILogger _logger; 13 | 14 | public LoggingDependencyImpl(ILogger logger) 15 | { 16 | _logger = logger; 17 | } 18 | 19 | public void Log(string message) 20 | { 21 | _logger.LogInformation(message); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Redis/PocoConverter.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs; 2 | using Newtonsoft.Json; 3 | 4 | namespace Indigo.Functions.Redis 5 | { 6 | public class PocoConverter : IConverter 7 | where T : class 8 | { 9 | public T Convert(string input) 10 | { 11 | if (input == null) 12 | { 13 | return null; 14 | } 15 | 16 | try 17 | { 18 | return JsonConvert.DeserializeObject(input); 19 | } 20 | catch (JsonException) 21 | { 22 | return null; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/ILoggingDependency.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | 3 | namespace Indigo.Functions.Autofac.IntegrationTests.Target 4 | { 5 | public interface ILoggingDependency 6 | { 7 | void Log(string message); 8 | } 9 | 10 | public class LoggingDependencyImpl : ILoggingDependency 11 | { 12 | private readonly ILogger _logger; 13 | 14 | public LoggingDependencyImpl(ILogger logger) 15 | { 16 | _logger = logger; 17 | } 18 | 19 | public void Log(string message) 20 | { 21 | _logger.LogInformation(message); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/ILoggingDependency.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | 3 | namespace Indigo.Functions.Injection.IntegrationTests.Target 4 | { 5 | public interface ILoggingDependency 6 | { 7 | void Log(string message); 8 | } 9 | 10 | public class LoggingDependencyImpl : ILoggingDependency 11 | { 12 | private readonly ILogger _logger; 13 | 14 | public LoggingDependencyImpl(ILogger logger) 15 | { 16 | _logger = logger; 17 | } 18 | 19 | public void Log(string message) 20 | { 21 | _logger.LogInformation(message); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests/Indigo.Functions.Redis.IntegrationTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /sample/AutofacFunctionSample/DependencyInjectionConfig.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Indigo.Functions.Autofac; 3 | using Sample.Storage; 4 | 5 | namespace AutofacFunctionSample 6 | { 7 | public class DependencyInjectionConfig : IDependencyConfig 8 | { 9 | public void RegisterComponents(ContainerBuilder builder) 10 | { 11 | builder.RegisterType().As().SingleInstance(); 12 | builder.RegisterType().As(); 13 | builder.RegisterType().As(); 14 | builder.RegisterType().As(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /script/release.ps1: -------------------------------------------------------------------------------- 1 | param( 2 | [string]$libName, 3 | [string]$version 4 | ) 5 | 6 | Write-Host "Running build" -ForegroundColor Blue 7 | 8 | dotnet msbuild $PsScriptRoot\..\src\indigo.functions.$libName\Indigo.Functions.$libName.csproj '/consoleLoggerParameters:Summary;Verbosity=minimal' /m /t:Rebuild /nologo /p:TreatWarningsAsErrors=true /p:Configuration=Release 9 | 10 | Write-Host "Publishing to Nuget" -ForegroundColor Blue 11 | 12 | $apiKey = Get-Content "$PsScriptRoot\..\..\vault\keys\nuget\indigo.functions.apikey" 13 | nuget push "$PsScriptRoot\..\src\indigo.functions.$libName\bin\Release\Indigo.Functions.$libName.$version.nupkg" $apiKey -source https://api.nuget.org/v3/index.json 14 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests/Indigo.Functions.Injection.IntegrationTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Configuration/ConfigAttribute.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Description; 2 | using System; 3 | 4 | namespace Indigo.Functions.Configuration 5 | { 6 | [Binding] 7 | [AttributeUsage(AttributeTargets.Parameter | AttributeTargets.ReturnValue)] 8 | public class ConfigAttribute : Attribute 9 | { 10 | public ConfigAttribute() 11 | { } 12 | 13 | public ConfigAttribute(string settingName) 14 | { 15 | SettingName = settingName; 16 | } 17 | 18 | /// 19 | /// Name of the setting specified in App settings 20 | /// 21 | public string SettingName { get; set; } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Autofac/InjectConverter.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Indigo.Functions.Autofac.Internal; 3 | using Microsoft.Azure.WebJobs; 4 | 5 | namespace Indigo.Functions.Autofac 6 | { 7 | public class InjectConverter : IConverter 8 | { 9 | private readonly JobHostConfiguration _configuration; 10 | private readonly IContainer _container; 11 | 12 | public InjectConverter(JobHostConfiguration configuration, IContainer container) 13 | { 14 | _configuration = configuration; 15 | _container = container; 16 | } 17 | 18 | public T Convert(Anonymous input) 19 | { 20 | return _container.Resolve(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Unity/InjectConverter.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Unity.Internal; 2 | using Microsoft.Azure.WebJobs; 3 | using Unity; 4 | 5 | namespace Indigo.Functions.Unity 6 | { 7 | public class InjectConverter : IConverter 8 | { 9 | private readonly JobHostConfiguration _configuration; 10 | private readonly UnityContainer _container; 11 | 12 | public InjectConverter(JobHostConfiguration configuration, UnityContainer container) 13 | { 14 | _configuration = configuration; 15 | _container = container; 16 | } 17 | 18 | public T Convert(Anonymous input) 19 | { 20 | return _container.Resolve(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs; 2 | using Microsoft.Azure.WebJobs.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | [assembly: WebJobsStartup(typeof(Indigo.Functions.Injection.IntegrationTests.Target.Startup))] 6 | namespace Indigo.Functions.Injection.IntegrationTests.Target 7 | { 8 | public class Startup : IWebJobsStartup 9 | { 10 | public void Configure(IWebJobsBuilder builder) 11 | { 12 | builder.Services.AddTransient(); 13 | builder.Services.AddTransient(); 14 | builder.Services.AddTransient(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sample/Sample.Storage/ITableAccess.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | 3 | namespace Sample.Storage 4 | { 5 | public interface ITableAccess 6 | { 7 | string QueryByKey(string key); 8 | } 9 | 10 | public class CloudTableAccess : ITableAccess 11 | { 12 | private readonly ILogger _logger; 13 | 14 | public CloudTableAccess(ILogger logger) 15 | { 16 | _logger = logger; 17 | } 18 | 19 | public string QueryByKey(string key) 20 | { 21 | _logger.LogInformation($"{typeof(CloudTableAccess)}: received query for key '{key}'"); 22 | 23 | // simplified as this is a sample project 24 | return $"Value stored at {key}"; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/InjectionFunctionSample/Startup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs; 2 | using Microsoft.Azure.WebJobs.Hosting; 3 | using Microsoft.Extensions.DependencyInjection; 4 | using Sample.Storage; 5 | 6 | [assembly: WebJobsStartup(typeof(InjectionFunctionSample.Startup))] 7 | namespace InjectionFunctionSample 8 | { 9 | public class Startup : IWebJobsStartup 10 | { 11 | public void Configure(IWebJobsBuilder builder) 12 | { 13 | builder.Services.AddSingleton(); 14 | builder.Services.AddTransient(); 15 | builder.Services.AddTransient(); 16 | builder.Services.AddTransient(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sample/RedisFunctionSample/RedisFunctionSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | PreserveNewest 16 | Never 17 | 18 | 19 | -------------------------------------------------------------------------------- /sample/ConfigurationFunctionSample/ConfigurationFunctionSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | PreserveNewest 13 | 14 | 15 | PreserveNewest 16 | Never 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget/Function.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | 7 | namespace Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget 8 | { 9 | public static class Function 10 | { 11 | [FunctionName("NonPublicConfigFunction")] 12 | public static IActionResult NonPublicConfigFunction( 13 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "NonPublicConfigFunction")] HttpRequest req, 14 | [Inject] IDependency dependency, 15 | TraceWriter log) 16 | { 17 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget/Function.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | 7 | namespace Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget 8 | { 9 | public static class Function 10 | { 11 | [FunctionName("NonPublicConfigFunction")] 12 | public static IActionResult NonPublicConfigFunction( 13 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "NonPublicConfigFunction")] HttpRequest req, 14 | [Inject] IDependency dependency, 15 | TraceWriter log) 16 | { 17 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/Indigo.Functions.Redis.IntegrationTests.Target.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/Indigo.Functions.Unity.IntegrationTests.Target.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/Indigo.Functions.Autofac.IntegrationTests.Target.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/InjectionFunctionSample/InjectionFunctionSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | Never 20 | 21 | 22 | -------------------------------------------------------------------------------- /sample/UnityFunctionSample/UnityFunctionSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | Never 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/Indigo.Functions.Injection.IntegrationTests.Target.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /sample/AutofacFunctionSample/AutofacFunctionSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | PreserveNewest 16 | 17 | 18 | PreserveNewest 19 | Never 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget/Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Configuration.IntegrationTests.Target/Indigo.Functions.Configuration.IntegrationTests.Target.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | PreserveNewest 15 | 16 | 17 | PreserveNewest 18 | Never 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Configuration.IntegrationTests.Target/local.settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "IsEncrypted": false, 3 | "Values": { 4 | "AzureWebJobsStorage": "UseDevelopmentStorage=true", 5 | "AzureWebJobsDashboard": "UseDevelopmentStorage=true", 6 | "bool": "true", 7 | "byte": "255", 8 | "sbyte": "127", 9 | "char": "X", 10 | "datetime": "2018-04-13 14:00:00", 11 | "datetimeoffset": "2018-04-13 14:00:00 +00:00", 12 | "decimal": "79228162514264337593543950335", 13 | "double": "12345.67890123456", 14 | "float": "123.456789", 15 | "guid": "e20f2d60-3174-433f-a817-1131e9338978", 16 | "int": "2147483647", 17 | "uint": "4294967295", 18 | "long": "9223372036854775807", 19 | "ulong": "18446744073709551615", 20 | "short": "32767", 21 | "ushort": "65535", 22 | "string": "abc", 23 | "timespan": "6:12:14:45", 24 | "FUNCTIONS_WORKER_RUNTIME": "dotnet" 25 | }, 26 | "ConnectionStrings": {} 27 | } -------------------------------------------------------------------------------- /sample/ConfigurationFunctionSample/ConfigFunction.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Configuration; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Azure.WebJobs; 5 | using Microsoft.Azure.WebJobs.Extensions.Http; 6 | using Microsoft.Azure.WebJobs.Host; 7 | 8 | namespace ConfigurationFunctionSample 9 | { 10 | public static class ConfigFunction 11 | { 12 | [FunctionName("ConfigFunction")] 13 | public static IActionResult Run( 14 | [HttpTrigger(AuthorizationLevel.Function, "GET")] HttpRequest req, 15 | [Config(SettingName = "test1")] string settingValue1, 16 | [Config(SettingName = "test2")] string settingValue2, 17 | [Config("test3")] string settingValue3, 18 | TraceWriter log) 19 | { 20 | return new OkObjectResult( 21 | $"Values are test1: {settingValue1}, test2: {settingValue2}, test3: {settingValue3}"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sample/KeyVaultFunctionSample/KeyVaultFunctionSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | v2 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | PreserveNewest 17 | 18 | 19 | PreserveNewest 20 | Never 21 | 22 | 23 | -------------------------------------------------------------------------------- /sample/UnityFunctionSample/InjectedFunction.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Unity; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Azure.WebJobs; 5 | using Microsoft.Azure.WebJobs.Extensions.Http; 6 | using Microsoft.Extensions.Logging; 7 | using Sample.Storage; 8 | 9 | namespace UnityFunctionSample 10 | { 11 | public static class InjectedFunction 12 | { 13 | [FunctionName("InjectableFunctionExample")] 14 | public static IActionResult Run( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "{key}")] HttpRequest req, 16 | string key, 17 | [Inject] IStorageAccess storageAccess, 18 | ILogger logger) 19 | { 20 | logger.LogInformation($"Injected instance of {typeof(IStorageAccess)} is {storageAccess.GetType()}"); 21 | 22 | var value = storageAccess.RetrieveValue(key); 23 | return new OkObjectResult($"Value for key '{key}' = '{value}'"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample/AutofacFunctionSample/InjectedFunction.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Autofac; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Azure.WebJobs; 5 | using Microsoft.Azure.WebJobs.Extensions.Http; 6 | using Microsoft.Extensions.Logging; 7 | using Sample.Storage; 8 | 9 | namespace AutofacFunctionSample 10 | { 11 | public static class InjectedFunction 12 | { 13 | [FunctionName("InjectableFunctionExample")] 14 | public static IActionResult Run( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "{key}")] HttpRequest req, 16 | string key, 17 | [Inject] IStorageAccess storageAccess, 18 | ILogger logger) 19 | { 20 | logger.LogInformation($"Injected instance of {typeof(IStorageAccess)} is {storageAccess.GetType()}"); 21 | 22 | var value = storageAccess.RetrieveValue(key); 23 | return new OkObjectResult($"Value for key '{key}' = '{value}'"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sample/InjectionFunctionSample/InjectedFunction.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Injection; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Azure.WebJobs; 5 | using Microsoft.Azure.WebJobs.Extensions.Http; 6 | using Microsoft.Extensions.Logging; 7 | using Sample.Storage; 8 | 9 | namespace InjectionFunctionSample 10 | { 11 | public static class InjectedFunction 12 | { 13 | [FunctionName("InjectableFunctionExample")] 14 | public static IActionResult Run( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "{key}")] HttpRequest req, 16 | string key, 17 | [Inject] IStorageAccess storageAccess, 18 | ILogger logger) 19 | { 20 | logger.LogInformation($"Injected instance of {typeof(IStorageAccess)} is {storageAccess.GetType()}"); 21 | 22 | var value = storageAccess.RetrieveValue(key); 23 | return new OkObjectResult($"Value for key '{key}' = '{value}'"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (c) 2018 Daulet Zhanguzin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /sample/Sample.Storage/IStorageAccess.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | 3 | namespace Sample.Storage 4 | { 5 | public interface IStorageAccess 6 | { 7 | string RetrieveValue(string key); 8 | } 9 | 10 | public class StorageAccess : IStorageAccess 11 | { 12 | private readonly ICache _cache; 13 | private readonly ILogger _logger; 14 | private readonly ITableAccess _tableAccess; 15 | 16 | public StorageAccess(ICache cache, ILogger logger, ITableAccess tableAccess) 17 | { 18 | _cache = cache; 19 | _logger = logger; 20 | _tableAccess = tableAccess; 21 | } 22 | 23 | public string RetrieveValue(string key) 24 | { 25 | var value = _cache.StringGet(key); 26 | 27 | if (value == null) 28 | { 29 | _logger.LogInformation($"{typeof(StorageAccess)}: cache miss for '{key}', querying table"); 30 | 31 | value = _tableAccess.QueryByKey(key); 32 | _cache.StringSet(key, value); 33 | } 34 | 35 | return value; 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/ResourceFunction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using StackExchange.Redis; 6 | 7 | namespace Indigo.Functions.Redis.IntegrationTests.Target 8 | { 9 | public static class ResourceFunction 10 | { 11 | [FunctionName("ResourceFunction1")] 12 | public static IActionResult GetMultiplexer1( 13 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "resource/multiplexer1")] HttpRequest request, 14 | [Redis] IConnectionMultiplexer connectionMultiplexer) 15 | { 16 | return new OkObjectResult($"{connectionMultiplexer.GetHashCode()}"); 17 | } 18 | 19 | [FunctionName("ResourceFunction2")] 20 | public static IActionResult GetMultiplexer2( 21 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "resource/multiplexer2")] HttpRequest request, 22 | [Redis] IConnectionMultiplexer connectionMultiplexer) 23 | { 24 | return new OkObjectResult($"{connectionMultiplexer.GetHashCode()}"); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /sample/RedisFunctionSample/TestFunction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | using Newtonsoft.Json; 7 | using System.IO; 8 | 9 | namespace RedisFunctionSample 10 | { 11 | public static class TestFunction 12 | { 13 | [FunctionName("Test")] 14 | public static IActionResult Run( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "test")] HttpRequest req, 16 | TraceWriter log) 17 | { 18 | log.Info("C# HTTP trigger function processed a request."); 19 | 20 | string name = req.Query["name"]; 21 | 22 | using (var reader = new StreamReader(req.Body)) 23 | { 24 | string requestBody = reader.ReadToEnd(); 25 | dynamic data = JsonConvert.DeserializeObject(requestBody); 26 | name = name ?? data?.name; 27 | } 28 | 29 | return name != null 30 | ? (ActionResult)new OkObjectResult($"Hello, {name}") 31 | : new BadRequestObjectResult("Please pass a name on the query string or in the request body"); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Injection/InjectExtension.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Injection.Internal; 2 | using Microsoft.Azure.WebJobs.Host.Bindings; 3 | using Microsoft.Azure.WebJobs.Host.Config; 4 | using Microsoft.Extensions.DependencyInjection; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace Indigo.Functions.Injection 8 | { 9 | public class InjectExtension : IExtensionConfigProvider 10 | { 11 | private readonly ILoggerFactory _loggerFactory; 12 | private readonly IServiceCollection _serviceCollection; 13 | 14 | public InjectExtension( 15 | ILoggerFactory loggerFactory, 16 | IServiceCollection serviceCollection) 17 | { 18 | _loggerFactory = loggerFactory; 19 | _serviceCollection = serviceCollection; 20 | } 21 | 22 | public void Initialize(ExtensionConfigContext context) 23 | { 24 | var rule = context.AddBindingRule(); 25 | rule.BindToInput((attribute) => null); 26 | 27 | var logger = _loggerFactory.CreateLogger("Host.General"); 28 | _serviceCollection.AddSingleton(logger); 29 | 30 | var container = _serviceCollection.BuildServiceProvider(); 31 | rule.AddOpenConverter(typeof(InjectConverter<>), container); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /sample/KeyVaultFunctionSample/KeyVaultFunction.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.KeyVault; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Azure.KeyVault; 5 | using Microsoft.Azure.WebJobs; 6 | using Microsoft.Azure.WebJobs.Host; 7 | using System.IO; 8 | using System.Threading.Tasks; 9 | 10 | namespace KeyVaultFunctionSample 11 | { 12 | public static class KeyVaultFunction 13 | { 14 | [FunctionName("KeyVault_SetSecret")] 15 | public static async Task SetSecretAsync( 16 | [HttpTrigger("POST", Route = "secret/{secretName}")] HttpRequest req, 17 | string secretName, 18 | [Secret] KeyVaultClient vaultClient, 19 | TraceWriter log) 20 | { 21 | string value = null; 22 | using (var reader = new StreamReader(req.Body)) 23 | { 24 | value = reader.ReadToEnd(); 25 | } 26 | if (string.IsNullOrEmpty(value)) 27 | { 28 | return new BadRequestObjectResult("Pass secret value in request body"); 29 | } 30 | 31 | var secretBundle = await vaultClient.SetSecretAsync(null, secretName, value); 32 | 33 | return new OkObjectResult($"Created secret {secretBundle.SecretIdentifier}, value: {secretBundle.Value}"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/DatabaseFunction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | using StackExchange.Redis; 7 | using System.Threading.Tasks; 8 | 9 | namespace Indigo.Functions.Redis.IntegrationTests.Target 10 | { 11 | public static class DatabaseFunction 12 | { 13 | [FunctionName("DatabaseFunction")] 14 | public static IActionResult Run( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "database/{key}")] HttpRequest request, 16 | string key, 17 | [Redis] IDatabase database, 18 | TraceWriter log) 19 | { 20 | string value = database.StringGet(key); 21 | return new OkObjectResult(value); 22 | } 23 | 24 | [FunctionName("DatabaseAsyncFunction")] 25 | public static async Task RunAsync( 26 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "databaseasync/{key}")] HttpRequest request, 27 | string key, 28 | [Redis] IDatabase database, 29 | TraceWriter log) 30 | { 31 | string value = await database.StringGetAsync(key); 32 | return new OkObjectResult(value); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ############### 2 | # Node.js 3 | ############### 4 | 5 | node_modules/ 6 | package-lock.json 7 | 8 | ############### 9 | # VS Code 10 | ############### 11 | 12 | .vscode/* 13 | !.vscode/settings.json 14 | !.vscode/tasks.json 15 | !.vscode/launch.json 16 | !.vscode/extensions.json 17 | 18 | ############### 19 | # Visual Studio 20 | ############### 21 | 22 | ## Ignore Visual Studio temporary files, build results, and 23 | ## files generated by popular Visual Studio add-ons. 24 | ## 25 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 26 | 27 | # User-specific files 28 | *.suo 29 | *.user 30 | *.userosscache 31 | *.sln.docstates 32 | 33 | # User-specific files (MonoDevelop/Xamarin Studio) 34 | *.userprefs 35 | 36 | # Build results 37 | [Dd]ebug/ 38 | [Dd]ebugPublic/ 39 | [Rr]elease/ 40 | [Rr]eleases/ 41 | x64/ 42 | x86/ 43 | bld/ 44 | [Bb]in/ 45 | [Oo]bj/ 46 | [Ll]og/ 47 | 48 | # NuGet Packages 49 | *.nupkg 50 | # The packages folder can be ignored because of Package Restore 51 | **/packages/* 52 | # except build/, which is used as an MSBuild target. 53 | !**/packages/build/ 54 | # Uncomment if necessary however generally it will be regenerated when needed 55 | #!**/packages/repositories.config 56 | # NuGet v3's project.json files produces more ignoreable files 57 | *.nuget.props 58 | *.nuget.targets 59 | 60 | # Visual Studio 2015/2017 cache/options directory 61 | .vs/ 62 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Redis/RedisAsyncCollector.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs; 2 | using StackExchange.Redis; 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | namespace Indigo.Functions.Redis 8 | { 9 | internal class RedisAsyncCollector : IAsyncCollector 10 | { 11 | private readonly string _key; 12 | private readonly Lazy> _lazyDatabase; 13 | 14 | public RedisAsyncCollector(RedisAttribute attribute) 15 | { 16 | _key = attribute.Key; 17 | _lazyDatabase = new Lazy>(async () => 18 | { 19 | var connectionMultiplexer = await ConnectionMultiplexer 20 | .ConnectAsync(attribute.Configuration) 21 | .ConfigureAwait(false); 22 | return connectionMultiplexer.GetDatabase(); 23 | }); 24 | } 25 | 26 | public async Task AddAsync(string item, CancellationToken cancellationToken = default(CancellationToken)) 27 | { 28 | var database = await _lazyDatabase.Value.ConfigureAwait(false); 29 | await database.StringSetAsync(_key, item).ConfigureAwait(false); 30 | } 31 | 32 | public Task FlushAsync(CancellationToken cancellationToken = default(CancellationToken)) 33 | { 34 | return Task.CompletedTask; 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/StringFunction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | using System.IO; 7 | using System.Threading.Tasks; 8 | 9 | namespace Indigo.Functions.Redis.IntegrationTests.Target 10 | { 11 | public static class StringFunction 12 | { 13 | [FunctionName("GetString")] 14 | public static IActionResult GetString( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "string/{key}")] HttpRequest request, 16 | [Redis(Key = "{key}")] string cachedValue, 17 | TraceWriter log) 18 | { 19 | return new OkObjectResult(cachedValue); 20 | } 21 | 22 | [FunctionName("SetString")] 23 | public static async Task SetString( 24 | [HttpTrigger(AuthorizationLevel.Function, "POST", Route = "string/{key}")] HttpRequest request, 25 | [Redis(Key = "{key}")] IAsyncCollector collector, 26 | TraceWriter log) 27 | { 28 | string value; 29 | using (var reader = new StreamReader(request.Body)) 30 | { 31 | value = reader.ReadToEnd(); 32 | await collector.AddAsync(value); 33 | } 34 | return new OkObjectResult(value); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Redis/Indigo.Functions.Redis.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | True 6 | 7 | 8 | 9 | true 10 | Redis bindings for Azure Functions 11 | Azure Functions bindings to abstract away Redis boilerpate 12 | 0.4-prerelease 13 | 14 | Version 0.4 15 | 16 | * Memory management improvements via sharing IConnectionMultiplexer instance; 17 | 18 | Daulet Zhanguzin 19 | Copyright (c) Daulet Zhanguzin 20 | https://github.com/daulet/Indigo.Functions/blob/master/LICENSE.md 21 | azure functions azurefunc binding redis 22 | https://github.com/daulet/Indigo.Functions 23 | https://github.com/daulet/Indigo.Functions 24 | 25 | 26 | 27 | 28 | 29 | All 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/MultiplexerFunction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | using StackExchange.Redis; 7 | using System.Threading.Tasks; 8 | 9 | namespace Indigo.Functions.Redis.IntegrationTests.Target 10 | { 11 | public static class MultiplexerFunction 12 | { 13 | [FunctionName("MultiplexerFunction")] 14 | public static IActionResult Run( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "multiplexer/{key}")] HttpRequest request, 16 | string key, 17 | [Redis] IConnectionMultiplexer connectionMultiplexer, 18 | TraceWriter log) 19 | { 20 | var database = connectionMultiplexer.GetDatabase(); 21 | string value = database.StringGet(key); 22 | return new OkObjectResult(value); 23 | } 24 | 25 | [FunctionName("MultiplexerAsyncFunction")] 26 | public static async Task RunAsync( 27 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "multiplexerasync/{key}")] HttpRequest request, 28 | string key, 29 | [Redis] IConnectionMultiplexer connectionMultiplexer, 30 | TraceWriter log) 31 | { 32 | var database = connectionMultiplexer.GetDatabase(); 33 | string value = await database.StringGetAsync(key); 34 | return new OkObjectResult(value); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests/InjectAttributeTests.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Net.Http; 3 | using System.Threading.Tasks; 4 | using Xunit; 5 | 6 | namespace Indigo.Functions.Injection.IntegrationTests 7 | { 8 | public class InjectAttributeTests 9 | { 10 | private static readonly HttpClient httpClient = new HttpClient(); 11 | private static readonly Config config = new Config(); 12 | 13 | [Fact] 14 | public async Task Inject_ConfigExists_InstanceInjected() 15 | { 16 | var response = 17 | await httpClient.GetAsync($"{config.TargetUrl}/Dependency"); 18 | 19 | Assert.True(response.IsSuccessStatusCode, "Failed to send HTTP GET"); 20 | } 21 | 22 | [Theory] 23 | [InlineData("setting1", "value1")] 24 | [InlineData("setting2", "value2")] 25 | public async Task Inject_DependencyOnIConfiguration_SettingRead(string settingName, string expectedValue) 26 | { 27 | var response = await httpClient.GetAsync($"{config.TargetUrl}/config/{settingName}"); 28 | var value = await response.Content.ReadAsStringAsync(); 29 | 30 | Assert.Equal(expectedValue, value); 31 | } 32 | 33 | [Fact] 34 | public async Task Inject_DependencyOnILogger_ILoggerInjected() 35 | { 36 | var response = 37 | await httpClient.GetAsync($"{config.TargetUrl}/LoggingDependency"); 38 | 39 | Assert.True(response.IsSuccessStatusCode, "Failed to send HTTP GET"); 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Configuration/Indigo.Functions.Configuration.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | True 6 | 7 | 8 | 9 | true 10 | Configuration bindings for Azure Functions 11 | Azure Functions bindings to read environments settings 12 | 0.2-prerelease 13 | 14 | Version 0.2 15 | 16 | * Use [Config] binding for all supported types. 17 | * Supported types include all built-in types, also DateTime, DateTimeOffset, Guid, TimeSpan. 18 | 19 | Daulet Zhanguzin 20 | Copyright (c) Daulet Zhanguzin 21 | https://github.com/daulet/Indigo.Functions/blob/master/LICENSE.md 22 | azure functions azurefunc binding configuration config 23 | https://github.com/daulet/Indigo.Functions 24 | https://github.com/daulet/Indigo.Functions 25 | 26 | 27 | 28 | 29 | 30 | All 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/PocoFunction.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | using Newtonsoft.Json; 7 | using System.IO; 8 | using System.Threading.Tasks; 9 | 10 | namespace Indigo.Functions.Redis.IntegrationTests.Target 11 | { 12 | public static class PocoFunction 13 | { 14 | [FunctionName("GetPoco")] 15 | public static IActionResult GetPoco( 16 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "poco/{key}")] HttpRequest request, 17 | [Redis(Key = "{key}")] CustomObject cachedValue, 18 | TraceWriter log) 19 | { 20 | return new OkObjectResult(JsonConvert.SerializeObject(cachedValue)); 21 | } 22 | 23 | [FunctionName("SetPoco")] 24 | public static async Task SetPoco( 25 | [HttpTrigger(AuthorizationLevel.Function, "POST", Route = "poco/{key}")] HttpRequest request, 26 | [Redis(Key = "{key}")] IAsyncCollector collector, 27 | TraceWriter log) 28 | { 29 | string requestBody; 30 | using (var reader = new StreamReader(request.Body)) 31 | { 32 | requestBody = reader.ReadToEnd(); 33 | var value = JsonConvert.DeserializeObject(requestBody); 34 | await collector.AddAsync(value); 35 | } 36 | return new OkObjectResult(requestBody); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/Function.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace Indigo.Functions.Autofac.IntegrationTests.Target 8 | { 9 | public static class Function 10 | { 11 | [FunctionName("ConfigurationFunction")] 12 | public static IActionResult ConfigurationFunction( 13 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "config/{key}")] HttpRequest req, 14 | string key, 15 | [Inject] ValueProvider provider) 16 | { 17 | return new OkObjectResult(provider.GetSettingValue(key)); 18 | } 19 | 20 | [FunctionName("DependencyFunction")] 21 | public static IActionResult DependencyFunction( 22 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Dependency")] HttpRequest req, 23 | [Inject] IDependency dependency, 24 | ILogger log) 25 | { 26 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 27 | } 28 | 29 | [FunctionName("LoggingDependencyFunction")] 30 | public static IActionResult LoggingDependencyFunction( 31 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "LoggingDependency")] HttpRequest req, 32 | [Inject] ILoggingDependency dependency, 33 | ILogger log) 34 | { 35 | dependency.Log($"Logging message to injected logger"); 36 | 37 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/Function.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace Indigo.Functions.Unity.IntegrationTests.Target 8 | { 9 | public static class Function 10 | { 11 | [FunctionName("ConfigurationFunction")] 12 | public static IActionResult ConfigurationFunction( 13 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "config/{key}")] HttpRequest req, 14 | string key, 15 | [Inject] ValueProvider provider) 16 | { 17 | return new OkObjectResult(provider.GetSettingValue(key)); 18 | } 19 | 20 | [FunctionName("DependencyFunction")] 21 | public static IActionResult DependencyFunction( 22 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Dependency")] HttpRequest req, 23 | [Inject] IDependency dependency, 24 | ILogger log) 25 | { 26 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 27 | } 28 | 29 | [FunctionName("LoggingDependencyFunction")] 30 | public static IActionResult LoggingDependencyFunction( 31 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "LoggingDependency")] HttpRequest req, 32 | [Inject] ILoggingDependency dependency, 33 | ILogger log) 34 | { 35 | dependency.Log($"Logging message to injected logger"); 36 | 37 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/Function.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Extensions.Logging; 6 | 7 | namespace Indigo.Functions.Injection.IntegrationTests.Target 8 | { 9 | public static class Function 10 | { 11 | [FunctionName("ConfigurationFunction")] 12 | public static IActionResult ConfigurationFunction( 13 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "config/{key}")] HttpRequest req, 14 | string key, 15 | [Inject] ValueProvider provider) 16 | { 17 | return new OkObjectResult(provider.GetSettingValue(key)); 18 | } 19 | 20 | [FunctionName("DependencyFunction")] 21 | public static IActionResult DependencyFunction( 22 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Dependency")] HttpRequest req, 23 | [Inject] IDependency dependency, 24 | ILogger log) 25 | { 26 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 27 | } 28 | 29 | [FunctionName("LoggingDependencyFunction")] 30 | public static IActionResult LoggingDependencyFunction( 31 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "LoggingDependency")] HttpRequest req, 32 | [Inject] ILoggingDependency dependency, 33 | ILogger log) 34 | { 35 | dependency.Log($"Logging message to injected logger"); 36 | 37 | return new OkObjectResult($"Instance of dependency {dependency.GetType()}"); 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /sample/Sample.Storage/ICache.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Logging; 2 | using System.Collections.Generic; 3 | 4 | namespace Sample.Storage 5 | { 6 | public interface ICache 7 | { 8 | string StringGet(string key); 9 | 10 | void StringSet(string key, string value); 11 | } 12 | 13 | public class CacheProvider : ICache 14 | { 15 | private readonly ICacheConfigProvider _configProvider; 16 | private readonly ILogger _logger; 17 | private readonly LinkedList _orderedKeys; // oldest key elimination policy 18 | private readonly IDictionary _values; 19 | 20 | public CacheProvider(ICacheConfigProvider configProvider, ILogger logger) 21 | { 22 | _configProvider = configProvider; 23 | _logger = logger; 24 | _orderedKeys = new LinkedList(); 25 | _values = new Dictionary(); 26 | } 27 | 28 | public string StringGet(string key) 29 | { 30 | _logger.LogInformation($"{typeof(CacheProvider)}: received query for key '{key}'"); 31 | 32 | return _values.ContainsKey(key) ? _values[key] : null; 33 | } 34 | 35 | public void StringSet(string key, string value) 36 | { 37 | _logger.LogInformation($"{typeof(CacheProvider)}: storing value for key '{key}'"); 38 | 39 | if (!_values.ContainsKey(key)) 40 | { 41 | _orderedKeys.AddLast(key); 42 | } 43 | 44 | if (_orderedKeys.Count > _configProvider.GetCacheSize()) 45 | { 46 | var keyToRemove = _orderedKeys.First.Value; 47 | _orderedKeys.RemoveFirst(); 48 | _values.Remove(keyToRemove); 49 | } 50 | 51 | _values[key] = value; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Autofac/Indigo.Functions.Autofac.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | True 6 | 7 | 8 | 9 | true 10 | Autofac DI bindings for Azure Functions 11 | Azure Functions bindings to inject your dependencies with Autofac 12 | 0.4-prerelease 13 | 14 | Version 0.4 15 | 16 | * Use [Inject] binding for all injectable dependencies. 17 | * Implement IDependencyConfig to configure Autofac components and declare your dependencies. 18 | * Auto inject (no registration required) Microsoft.Extensions.Configuration.IConfiguration to read App Settings. 19 | * Auto inject (no registration required) Microsoft.Extensions.Logging.ILogger to log to both file system and Application Insights. 20 | 21 | Daulet Zhanguzin 22 | Copyright (c) Daulet Zhanguzin 23 | https://github.com/daulet/Indigo.Functions/blob/master/LICENSE.md 24 | azure functions azurefunc binding di dependency injection autofac container 25 | https://github.com/daulet/Indigo.Functions 26 | https://github.com/daulet/Indigo.Functions 27 | 28 | 29 | 30 | 31 | 32 | 33 | All 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Unity/Indigo.Functions.Unity.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | True 6 | 7 | 8 | 9 | true 10 | Unity DI bindings for Azure Functions 11 | Azure Functions bindings to inject your dependencies with Unity containers 12 | 0.4-prerelease 13 | 14 | Version 0.4 15 | 16 | * Use [Inject] binding for all injectable dependencies. 17 | * Implement IDependencyConfig to configure Unity container and declare your dependencies. 18 | * Auto inject (no registration required) Microsoft.Extensions.Configuration.IConfiguration to read App Settings. 19 | * Auto inject (no registration required) Microsoft.Extensions.Logging.ILogger to log to both file system and Application Insights. 20 | 21 | Daulet Zhanguzin 22 | Copyright (c) Daulet Zhanguzin 23 | https://github.com/daulet/Indigo.Functions/blob/master/LICENSE.md 24 | azure functions azurefunc binding di dependency injection unity container 25 | https://github.com/daulet/Indigo.Functions 26 | https://github.com/daulet/Indigo.Functions 27 | 28 | 29 | 30 | 31 | 32 | All 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Injection/Indigo.Functions.Injection.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | true 9 | Dependency injection bindings for Azure Functions 10 | Azure Functions bindings to inject your dependencies with ASP.NET Core's IoC container 11 | 1.0.1 12 | 13 | Version 1.0.1 14 | 15 | * Use [Inject] binding for all injectable dependencies. 16 | * Register your dependencies with IWebJobsBuilder.Services in body of IWebJobsStartup.Configure() (aka Startup). 17 | * Auto inject (no registration required) Microsoft.Extensions.Configuration.IConfiguration to read App Settings. 18 | * Auto inject (no registration required) Microsoft.Extensions.Logging.ILogger to log to both file system and Application Insights. 19 | 20 | Daulet Zhanguzin 21 | Copyright (c) Daulet Zhanguzin 22 | https://github.com/daulet/Indigo.Functions/blob/master/LICENSE.md 23 | azure functions azurefunc binding di dependency injection asp.net ioc container 24 | https://github.com/daulet/Indigo.Functions 25 | https://github.com/daulet/Indigo.Functions 26 | 27 | 28 | 29 | 30 | 31 | 32 | All 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Unity/InjectExtension.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Unity.Internal; 2 | using Microsoft.Azure.WebJobs.Host.Bindings; 3 | using Microsoft.Azure.WebJobs.Host.Config; 4 | using Microsoft.Extensions.Configuration; 5 | using System; 6 | using System.Linq; 7 | using Unity; 8 | 9 | namespace Indigo.Functions.Unity 10 | { 11 | public class InjectExtension : IExtensionConfigProvider 12 | { 13 | public void Initialize(ExtensionConfigContext context) 14 | { 15 | var rule = context.AddBindingRule(); 16 | 17 | rule.BindToInput((attribute) => null); 18 | 19 | var dependencyConfig = InitializeContainer(context); 20 | if (dependencyConfig != null) 21 | { 22 | var container = new UnityContainer(); 23 | dependencyConfig.RegisterComponents(container); 24 | 25 | var configuration = new ConfigurationBuilder() 26 | .AddEnvironmentVariables() 27 | .Build(); 28 | container.RegisterInstance(configuration); 29 | 30 | var logger = context.Config.LoggerFactory.CreateLogger("Host.General"); 31 | container.RegisterInstance(logger); 32 | 33 | rule.AddOpenConverter(typeof(InjectConverter<>), context.Config, container); 34 | } 35 | } 36 | 37 | private static IDependencyConfig InitializeContainer(ExtensionConfigContext context) 38 | { 39 | var configType = context.Config.TypeLocator.GetTypes() 40 | .Where(x => typeof(IDependencyConfig).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract) 41 | .FirstOrDefault(); 42 | 43 | IDependencyConfig dependencyConfig = null; 44 | if (configType != null) 45 | { 46 | var configInstance = Activator.CreateInstance(configType); 47 | dependencyConfig = (IDependencyConfig)configInstance; 48 | } 49 | return dependencyConfig; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Configuration.IntegrationTests/ConfigAttributeTests.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | using System.Net.Http; 3 | using System.Threading.Tasks; 4 | using Xunit; 5 | 6 | namespace Indigo.Functions.Configuration.IntegrationTests 7 | { 8 | public class ConfigAttributeTests 9 | { 10 | private static readonly HttpClient httpClient = new HttpClient(); 11 | 12 | [Fact] 13 | public async Task Config_NoSettingName_FunctionNotRegistered() 14 | { 15 | var response = 16 | await httpClient.GetAsync(@"http://localhost:7072/test/NoSettingName"); 17 | 18 | Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); 19 | } 20 | 21 | [Theory] 22 | [InlineData("http://localhost:7072/test/bool")] 23 | [InlineData("http://localhost:7072/test/byte")] 24 | [InlineData("http://localhost:7072/test/sbyte")] 25 | [InlineData("http://localhost:7072/test/char")] 26 | [InlineData("http://localhost:7072/test/datetime")] 27 | [InlineData("http://localhost:7072/test/datetimeoffset")] 28 | [InlineData("http://localhost:7072/test/decimal")] 29 | [InlineData("http://localhost:7072/test/double")] 30 | [InlineData("http://localhost:7072/test/float")] 31 | [InlineData("http://localhost:7072/test/guid")] 32 | [InlineData("http://localhost:7072/test/int")] 33 | [InlineData("http://localhost:7072/test/uint")] 34 | [InlineData("http://localhost:7072/test/long")] 35 | [InlineData("http://localhost:7072/test/ulong")] 36 | [InlineData("http://localhost:7072/test/short")] 37 | [InlineData("http://localhost:7072/test/ushort")] 38 | [InlineData("http://localhost:7072/test/string")] 39 | [InlineData("http://localhost:7072/test/timespan")] 40 | public async Task Config_AllBuiltInTypes_ValueRead(string url) 41 | { 42 | var response = 43 | await httpClient.GetAsync(url); 44 | 45 | Assert.True(response.IsSuccessStatusCode, "See the function implementation for expectation"); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Autofac/InjectExtension.cs: -------------------------------------------------------------------------------- 1 | using Autofac; 2 | using Indigo.Functions.Autofac.Internal; 3 | using Microsoft.Azure.WebJobs.Host.Bindings; 4 | using Microsoft.Azure.WebJobs.Host.Config; 5 | using Microsoft.Extensions.Configuration; 6 | using System; 7 | using System.Linq; 8 | 9 | namespace Indigo.Functions.Autofac 10 | { 11 | public class InjectExtension : IExtensionConfigProvider 12 | { 13 | public void Initialize(ExtensionConfigContext context) 14 | { 15 | var rule = context.AddBindingRule(); 16 | 17 | rule.BindToInput((attribute) => null); 18 | 19 | var dependencyConfig = InitializeContainer(context); 20 | if (dependencyConfig != null) 21 | { 22 | var containerBuilder = new ContainerBuilder(); 23 | dependencyConfig.RegisterComponents(containerBuilder); 24 | 25 | var configuration = new ConfigurationBuilder() 26 | .AddEnvironmentVariables() 27 | .Build(); 28 | containerBuilder.RegisterInstance(configuration).As(); 29 | 30 | var logger = context.Config.LoggerFactory.CreateLogger("Host.General"); 31 | containerBuilder.RegisterInstance(logger); 32 | 33 | var container = containerBuilder.Build(); 34 | rule.AddOpenConverter(typeof(InjectConverter<>), context.Config, container); 35 | } 36 | } 37 | 38 | private static IDependencyConfig InitializeContainer(ExtensionConfigContext context) 39 | { 40 | var configType = context.Config.TypeLocator.GetTypes() 41 | .Where(x => typeof(IDependencyConfig).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract) 42 | .FirstOrDefault(); 43 | 44 | IDependencyConfig dependencyConfig = null; 45 | if (configType != null) 46 | { 47 | var configInstance = Activator.CreateInstance(configType); 48 | dependencyConfig = (IDependencyConfig)configInstance; 49 | } 50 | return dependencyConfig; 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /sample/RedisFunctionSample/RedisFunction.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Redis; 2 | using Microsoft.AspNetCore.Http; 3 | using Microsoft.AspNetCore.Mvc; 4 | using Microsoft.Azure.WebJobs; 5 | using StackExchange.Redis; 6 | using System.Collections.Generic; 7 | using System.IO; 8 | using System.Linq; 9 | 10 | namespace RedisFunctionSample 11 | { 12 | public static class RedisFunction 13 | { 14 | [FunctionName("Redis_GetKey")] 15 | public static string GetKey( 16 | [HttpTrigger("GET", Route = "cache/{key}")] HttpRequest req, 17 | string key, 18 | [Redis] IConnectionMultiplexer connectionMultiplexer) 19 | { 20 | var database = connectionMultiplexer.GetDatabase(); 21 | return database.StringGet(key); 22 | } 23 | 24 | [FunctionName("Redis_ListKeys")] 25 | public static IEnumerable ListKeys( 26 | [HttpTrigger("GET", Route = "cache")] HttpRequest req, 27 | [Redis] IConnectionMultiplexer connectionMultiplexer) 28 | { 29 | string pattern = req.Query["pattern"]; 30 | 31 | var randomEndpoint = connectionMultiplexer.GetEndPoints().First(); 32 | var server = connectionMultiplexer.GetServer(randomEndpoint); 33 | var keys = server.Keys(pattern: pattern); 34 | 35 | return keys.Select(x => x.ToString()); 36 | } 37 | 38 | [FunctionName("Redis_SetKey")] 39 | public static IActionResult SetKey( 40 | [HttpTrigger("POST", Route = "cache/{key}")] HttpRequest req, 41 | string key, 42 | [Redis] IConnectionMultiplexer connectionMultiplexer) 43 | { 44 | string value = null; 45 | using (var reader = new StreamReader(req.Body)) 46 | { 47 | value = reader.ReadToEnd(); 48 | } 49 | if (string.IsNullOrEmpty(value)) 50 | { 51 | return new BadRequestObjectResult("No value specified"); 52 | } 53 | 54 | var database = connectionMultiplexer.GetDatabase(); 55 | database.StringSet(key, value); 56 | return new OkObjectResult($"{key} = {value}"); 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/Indigo.Functions.KeyVault/KeyVaultExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.KeyVault; 2 | using Microsoft.Azure.WebJobs.Host.Config; 3 | using Microsoft.IdentityModel.Clients.ActiveDirectory; 4 | using System; 5 | using System.Threading.Tasks; 6 | 7 | namespace Indigo.Functions.KeyVault 8 | { 9 | public class KeyVaultExtension : IExtensionConfigProvider 10 | { 11 | public void Initialize(ExtensionConfigContext context) 12 | { 13 | var rule = context.AddBindingRule(); 14 | 15 | rule.WhenIsNull(nameof(SecretAttribute.SecretIdentifier)) 16 | .BindToInput(GetKeyVaultClient); 17 | 18 | rule.WhenIsNotNull(nameof(SecretAttribute.SecretIdentifier)) 19 | .BindToInput(GetSecretAsync); 20 | } 21 | 22 | private static KeyVaultClient.AuthenticationCallback GetAuthenticationCallback(string clientId, string clientSecret) 23 | { 24 | return new KeyVaultClient.AuthenticationCallback(async (authority, resource, scope) => 25 | { 26 | var authContext = new AuthenticationContext(authority); 27 | var clientCredential = new ClientCredential(clientId, clientSecret); 28 | var result = await authContext 29 | .AcquireTokenAsync(resource, clientCredential) 30 | .ConfigureAwait(false); 31 | 32 | if (result == null) 33 | { 34 | throw new InvalidOperationException("Failed to obtain the JWT token"); 35 | } 36 | return result.AccessToken; 37 | }); 38 | } 39 | 40 | private static KeyVaultClient GetKeyVaultClient(SecretAttribute attribute) 41 | { 42 | return new KeyVaultClient(GetAuthenticationCallback(attribute.ClientId, attribute.ClientSecret)); 43 | } 44 | 45 | private static async Task GetSecretAsync(SecretAttribute attribute) 46 | { 47 | var client = new KeyVaultClient(GetAuthenticationCallback(attribute.ClientId, attribute.ClientSecret)); 48 | var secret = await client.GetSecretAsync(attribute.SecretIdentifier); 49 | return secret.Value; 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Redis/RedisExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Host.Config; 2 | using StackExchange.Redis; 3 | using System; 4 | using System.Collections.Generic; 5 | 6 | namespace Indigo.Functions.Redis 7 | { 8 | public class RedisExtension : IExtensionConfigProvider 9 | { 10 | private readonly Dictionary _connections; 11 | 12 | public RedisExtension() 13 | { 14 | _connections = new Dictionary(); 15 | } 16 | 17 | public void Initialize(ExtensionConfigContext context) 18 | { 19 | var rule = context.AddBindingRule(); 20 | 21 | rule.AddValidator(ValidateRedisAttribute); 22 | 23 | // inputs 24 | rule.WhenIsNull(nameof(RedisAttribute.Key)) 25 | .BindToInput(GetConnectionMultiplexerValueFromAttribute); 26 | rule.WhenIsNull(nameof(RedisAttribute.Key)) 27 | .BindToInput(GetDatabaseValueFromAttribute); 28 | rule.WhenIsNotNull(nameof(RedisAttribute.Key)) 29 | .BindToInput(GetStringValueFromAttribute); 30 | 31 | // string output 32 | rule.WhenIsNotNull(nameof(RedisAttribute.Key)) 33 | .BindToCollector(attribute => new RedisAsyncCollector(attribute)); 34 | 35 | // generic converters 36 | rule.AddOpenConverter(typeof(StringConverter<>)); 37 | rule.AddOpenConverter(typeof(PocoConverter<>)); 38 | } 39 | 40 | private static void ValidateRedisAttribute(RedisAttribute attribute, Type parameterType) 41 | { 42 | if (string.IsNullOrEmpty(attribute.Configuration)) 43 | { 44 | throw new ArgumentException("RedisAttribute.Configuration parameter cannot be null", nameof(attribute)); 45 | } 46 | } 47 | 48 | private IConnectionMultiplexer GetConnectionMultiplexerValueFromAttribute(RedisAttribute attribute) 49 | { 50 | if (!_connections.ContainsKey(attribute.Configuration)) 51 | { 52 | _connections[attribute.Configuration] = ConnectionMultiplexer.Connect(attribute.Configuration); 53 | } 54 | return _connections[attribute.Configuration]; 55 | } 56 | 57 | private IDatabase GetDatabaseValueFromAttribute(RedisAttribute attribute) 58 | { 59 | var connectionMultiplexer = GetConnectionMultiplexerValueFromAttribute(attribute); 60 | return connectionMultiplexer.GetDatabase(); 61 | } 62 | 63 | private string GetStringValueFromAttribute(RedisAttribute attribute) 64 | { 65 | var connectionMultiplexer = GetConnectionMultiplexerValueFromAttribute(attribute); 66 | return connectionMultiplexer.GetDatabase().StringGet(attribute.Key); 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /script/test.ps1: -------------------------------------------------------------------------------- 1 | function Start-AzureFunction ([int]$port, [string]$workingDir) { 2 | Start-Process func -ArgumentList "host start --port $port" -WorkingDirectory $workingDir -PassThru 3 | } 4 | 5 | ################ 6 | # Test Autofac 7 | ################ 8 | 9 | Start-AzureFunction 7072 -workingDir "test\Indigo.Functions.Autofac.IntegrationTests.Target\bin\Debug\netstandard2.0" 10 | Start-AzureFunction 7073 -workingDir "test\Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget\bin\Debug\netstandard2.0" 11 | dotnet test test\Indigo.Functions.Injection.IntegrationTests\Indigo.Functions.Injection.IntegrationTests.csproj 12 | 13 | if ($LastExitCode -ne 0) { 14 | return $LastExitCode 15 | } 16 | 17 | # Kill processes only if previous actions succeeded, in case you need to debug 18 | Stop-Process (Get-Process func).Id 19 | 20 | #################### 21 | # Test Configuration 22 | #################### 23 | 24 | Start-AzureFunction 7072 -workingDir "test\Indigo.Functions.Configuration.IntegrationTests.Target\bin\Debug\netstandard2.0" 25 | dotnet test test\Indigo.Functions.Configuration.IntegrationTests\Indigo.Functions.Configuration.IntegrationTests.csproj 26 | 27 | if ($LastExitCode -ne 0) { 28 | return $LastExitCode 29 | } 30 | 31 | # Kill processes only if previous actions succeeded, in case you need to debug 32 | Stop-Process (Get-Process func).Id 33 | 34 | ################ 35 | # Test Injection 36 | ################ 37 | 38 | Start-AzureFunction 7072 -workingDir "test\Indigo.Functions.Injection.IntegrationTests.Target\bin\Debug\netstandard2.0" 39 | Start-AzureFunction 7073 -workingDir "test\Indigo.Functions.Injection.IntegrationTests.MisconfiguredTarget\bin\Debug\netstandard2.0" 40 | dotnet test test\Indigo.Functions.Injection.IntegrationTests\Indigo.Functions.Injection.IntegrationTests.csproj 41 | 42 | if ($LastExitCode -ne 0) { 43 | return $LastExitCode 44 | } 45 | 46 | # Kill processes only if previous actions succeeded, in case you need to debug 47 | Stop-Process (Get-Process func).Id 48 | 49 | ############ 50 | # Test Redis 51 | ############ 52 | 53 | Start-AzureFunction 7075 -workingDir "test\Indigo.Functions.Redis.IntegrationTests.Target\bin\Debug\netstandard2.0" 54 | Start-Process redis-server -PassThru 55 | dotnet test test\Indigo.Functions.Redis.IntegrationTests\Indigo.Functions.Redis.IntegrationTests.csproj --no-build 56 | 57 | if ($LastExitCode -ne 0) { 58 | return $LastExitCode 59 | } 60 | 61 | # Kill processes only if previous actions succeeded, in case you need to debug 62 | Stop-Process (Get-Process func).Id 63 | 64 | ################ 65 | # Test Unity 66 | ################ 67 | 68 | Start-AzureFunction 7072 -workingDir "test\Indigo.Functions.Unity.IntegrationTests.Target\bin\Debug\netstandard2.0" 69 | Start-AzureFunction 7073 -workingDir "test\Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget\bin\Debug\netstandard2.0" 70 | dotnet test test\Indigo.Functions.Injection.IntegrationTests\Indigo.Functions.Injection.IntegrationTests.csproj 71 | 72 | if ($LastExitCode -ne 0) { 73 | return $LastExitCode 74 | } 75 | 76 | # Kill processes only if previous actions succeeded, in case you need to debug 77 | Stop-Process (Get-Process func).Id 78 | -------------------------------------------------------------------------------- /src/Indigo.Functions.Configuration/ConfigExtension.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Azure.WebJobs.Host.Config; 2 | using Microsoft.Extensions.Configuration; 3 | using System; 4 | using System.Globalization; 5 | 6 | namespace Indigo.Functions.Configuration 7 | { 8 | public class ConfigExtension : IExtensionConfigProvider 9 | { 10 | private IConfigurationRoot _config; 11 | 12 | public void Initialize(ExtensionConfigContext context) 13 | { 14 | _config = new ConfigurationBuilder() 15 | .AddEnvironmentVariables() 16 | .Build(); 17 | 18 | var rule = context.AddBindingRule(); 19 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 20 | .BindToInput(GetSettingValueFromAppConfig); 21 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 22 | .BindToInput(GetSettingValueFromAppConfig); 23 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 24 | .BindToInput(GetSettingValueFromAppConfig); 25 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 26 | .BindToInput(GetSettingValueFromAppConfig); 27 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 28 | .BindToInput(GetDateTimeFromAppConfig); 29 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 30 | .BindToInput(GetDateTimeOffsetFromAppConfig); 31 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 32 | .BindToInput(GetSettingValueFromAppConfig); 33 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 34 | .BindToInput(GetSettingValueFromAppConfig); 35 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 36 | .BindToInput(GetSettingValueFromAppConfig); 37 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 38 | .BindToInput(GetGuidFromAppConfig); 39 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 40 | .BindToInput(GetSettingValueFromAppConfig); 41 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 42 | .BindToInput(GetSettingValueFromAppConfig); 43 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 44 | .BindToInput(GetSettingValueFromAppConfig); 45 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 46 | .BindToInput(GetSettingValueFromAppConfig); 47 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 48 | .BindToInput(GetSettingValueFromAppConfig); 49 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 50 | .BindToInput(GetSettingValueFromAppConfig); 51 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 52 | .BindToInput(GetSettingValueFromAppConfig); 53 | rule.WhenIsNotNull(nameof(ConfigAttribute.SettingName)) 54 | .BindToInput(GetTimeSpanFromAppConfig); 55 | } 56 | 57 | private DateTime GetDateTimeFromAppConfig(ConfigAttribute attribute) 58 | { 59 | return DateTime.Parse(_config[attribute.SettingName], CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal); 60 | } 61 | 62 | private DateTimeOffset GetDateTimeOffsetFromAppConfig(ConfigAttribute attribute) 63 | { 64 | return DateTimeOffset.Parse(_config[attribute.SettingName], CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal); 65 | } 66 | 67 | private Guid GetGuidFromAppConfig(ConfigAttribute attribute) 68 | { 69 | return Guid.Parse(_config[attribute.SettingName]); 70 | } 71 | 72 | private T GetSettingValueFromAppConfig(ConfigAttribute attribute) 73 | { 74 | return (T)Convert.ChangeType(_config[attribute.SettingName], typeof(T), CultureInfo.InvariantCulture); 75 | } 76 | 77 | private TimeSpan GetTimeSpanFromAppConfig(ConfigAttribute attribute) 78 | { 79 | return TimeSpan.Parse(_config[attribute.SettingName], CultureInfo.InvariantCulture); 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /sample/AutofacFunctionSample/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /sample/InjectionFunctionSample/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /sample/UnityFunctionSample/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /sample/ConfigurationFunctionSample/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.Target/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Injection.IntegrationTests.Target/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests.Target/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.Target/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Configuration.IntegrationTests.Target/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Autofac.IntegrationTests.MisconfiguredTarget/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | x64/ 19 | x86/ 20 | bld/ 21 | [Bb]in/ 22 | [Oo]bj/ 23 | [Ll]og/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | project.fragment.lock.json 46 | artifacts/ 47 | 48 | *_i.c 49 | *_p.c 50 | *_i.h 51 | *.ilk 52 | *.meta 53 | *.obj 54 | *.pch 55 | *.pdb 56 | *.pgc 57 | *.pgd 58 | *.rsp 59 | *.sbr 60 | *.tlb 61 | *.tli 62 | *.tlh 63 | *.tmp 64 | *.tmp_proj 65 | *.log 66 | *.vspscc 67 | *.vssscc 68 | .builds 69 | *.pidb 70 | *.svclog 71 | *.scc 72 | 73 | # Chutzpah Test files 74 | _Chutzpah* 75 | 76 | # Visual C++ cache files 77 | ipch/ 78 | *.aps 79 | *.ncb 80 | *.opendb 81 | *.opensdf 82 | *.sdf 83 | *.cachefile 84 | *.VC.db 85 | *.VC.VC.opendb 86 | 87 | # Visual Studio profiler 88 | *.psess 89 | *.vsp 90 | *.vspx 91 | *.sap 92 | 93 | # TFS 2012 Local Workspace 94 | $tf/ 95 | 96 | # Guidance Automation Toolkit 97 | *.gpState 98 | 99 | # ReSharper is a .NET coding add-in 100 | _ReSharper*/ 101 | *.[Rr]e[Ss]harper 102 | *.DotSettings.user 103 | 104 | # JustCode is a .NET coding add-in 105 | .JustCode 106 | 107 | # TeamCity is a build add-in 108 | _TeamCity* 109 | 110 | # DotCover is a Code Coverage Tool 111 | *.dotCover 112 | 113 | # NCrunch 114 | _NCrunch_* 115 | .*crunch*.local.xml 116 | nCrunchTemp_* 117 | 118 | # MightyMoose 119 | *.mm.* 120 | AutoTest.Net/ 121 | 122 | # Web workbench (sass) 123 | .sass-cache/ 124 | 125 | # Installshield output folder 126 | [Ee]xpress/ 127 | 128 | # DocProject is a documentation generator add-in 129 | DocProject/buildhelp/ 130 | DocProject/Help/*.HxT 131 | DocProject/Help/*.HxC 132 | DocProject/Help/*.hhc 133 | DocProject/Help/*.hhk 134 | DocProject/Help/*.hhp 135 | DocProject/Help/Html2 136 | DocProject/Help/html 137 | 138 | # Click-Once directory 139 | publish/ 140 | 141 | # Publish Web Output 142 | *.[Pp]ublish.xml 143 | *.azurePubxml 144 | # TODO: Comment the next line if you want to checkin your web deploy settings 145 | # but database connection strings (with potential passwords) will be unencrypted 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 150 | # checkin your Azure Web App publish settings, but sensitive information contained 151 | # in these scripts will be unencrypted 152 | PublishScripts/ 153 | 154 | # NuGet Packages 155 | *.nupkg 156 | # The packages folder can be ignored because of Package Restore 157 | **/packages/* 158 | # except build/, which is used as an MSBuild target. 159 | !**/packages/build/ 160 | # Uncomment if necessary however generally it will be regenerated when needed 161 | #!**/packages/repositories.config 162 | # NuGet v3's project.json files produces more ignoreable files 163 | *.nuget.props 164 | *.nuget.targets 165 | 166 | # Microsoft Azure Build Output 167 | csx/ 168 | *.build.csdef 169 | 170 | # Microsoft Azure Emulator 171 | ecf/ 172 | rcf/ 173 | 174 | # Windows Store app package directories and files 175 | AppPackages/ 176 | BundleArtifacts/ 177 | Package.StoreAssociation.xml 178 | _pkginfo.txt 179 | 180 | # Visual Studio cache files 181 | # files ending in .cache can be ignored 182 | *.[Cc]ache 183 | # but keep track of directories ending in .cache 184 | !*.[Cc]ache/ 185 | 186 | # Others 187 | ClientBin/ 188 | ~$* 189 | *~ 190 | *.dbmdl 191 | *.dbproj.schemaview 192 | *.jfm 193 | *.pfx 194 | *.publishsettings 195 | node_modules/ 196 | orleans.codegen.cs 197 | 198 | # Since there are multiple workflows, uncomment next line to ignore bower_components 199 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 200 | #bower_components/ 201 | 202 | # RIA/Silverlight projects 203 | Generated_Code/ 204 | 205 | # Backup & report files from converting an old project file 206 | # to a newer Visual Studio version. Backup files are not needed, 207 | # because we have git ;-) 208 | _UpgradeReport_Files/ 209 | Backup*/ 210 | UpgradeLog*.XML 211 | UpgradeLog*.htm 212 | 213 | # SQL Server files 214 | *.mdf 215 | *.ldf 216 | 217 | # Business Intelligence projects 218 | *.rdl.data 219 | *.bim.layout 220 | *.bim_*.settings 221 | 222 | # Microsoft Fakes 223 | FakesAssemblies/ 224 | 225 | # GhostDoc plugin setting file 226 | *.GhostDoc.xml 227 | 228 | # Node.js Tools for Visual Studio 229 | .ntvs_analysis.dat 230 | 231 | # Visual Studio 6 build log 232 | *.plg 233 | 234 | # Visual Studio 6 workspace options file 235 | *.opt 236 | 237 | # Visual Studio LightSwitch build output 238 | **/*.HTMLClient/GeneratedArtifacts 239 | **/*.DesktopClient/GeneratedArtifacts 240 | **/*.DesktopClient/ModelManifest.xml 241 | **/*.Server/GeneratedArtifacts 242 | **/*.Server/ModelManifest.xml 243 | _Pvt_Extensions 244 | 245 | # Paket dependency manager 246 | .paket/paket.exe 247 | paket-files/ 248 | 249 | # FAKE - F# Make 250 | .fake/ 251 | 252 | # JetBrains Rider 253 | .idea/ 254 | *.sln.iml 255 | 256 | # CodeRush 257 | .cr/ 258 | 259 | # Python Tools for Visual Studio (PTVS) 260 | __pycache__/ 261 | *.pyc -------------------------------------------------------------------------------- /sample/KeyVaultFunctionSample/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # Azure Functions localsettings file 5 | local.settings.json 6 | 7 | # User-specific files 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | [Ll]og/ 27 | 28 | # Visual Studio 2015 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # MSTest test Results 34 | [Tt]est[Rr]esult*/ 35 | [Bb]uild[Ll]og.* 36 | 37 | # NUNIT 38 | *.VisualState.xml 39 | TestResult.xml 40 | 41 | # Build Results of an ATL Project 42 | [Dd]ebugPS/ 43 | [Rr]eleasePS/ 44 | dlldata.c 45 | 46 | # DNX 47 | project.lock.json 48 | project.fragment.lock.json 49 | artifacts/ 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # NCrunch 117 | _NCrunch_* 118 | .*crunch*.local.xml 119 | nCrunchTemp_* 120 | 121 | # MightyMoose 122 | *.mm.* 123 | AutoTest.Net/ 124 | 125 | # Web workbench (sass) 126 | .sass-cache/ 127 | 128 | # Installshield output folder 129 | [Ee]xpress/ 130 | 131 | # DocProject is a documentation generator add-in 132 | DocProject/buildhelp/ 133 | DocProject/Help/*.HxT 134 | DocProject/Help/*.HxC 135 | DocProject/Help/*.hhc 136 | DocProject/Help/*.hhk 137 | DocProject/Help/*.hhp 138 | DocProject/Help/Html2 139 | DocProject/Help/html 140 | 141 | # Click-Once directory 142 | publish/ 143 | 144 | # Publish Web Output 145 | *.[Pp]ublish.xml 146 | *.azurePubxml 147 | # TODO: Comment the next line if you want to checkin your web deploy settings 148 | # but database connection strings (with potential passwords) will be unencrypted 149 | #*.pubxml 150 | *.publishproj 151 | 152 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 153 | # checkin your Azure Web App publish settings, but sensitive information contained 154 | # in these scripts will be unencrypted 155 | PublishScripts/ 156 | 157 | # NuGet Packages 158 | *.nupkg 159 | # The packages folder can be ignored because of Package Restore 160 | **/packages/* 161 | # except build/, which is used as an MSBuild target. 162 | !**/packages/build/ 163 | # Uncomment if necessary however generally it will be regenerated when needed 164 | #!**/packages/repositories.config 165 | # NuGet v3's project.json files produces more ignoreable files 166 | *.nuget.props 167 | *.nuget.targets 168 | 169 | # Microsoft Azure Build Output 170 | csx/ 171 | *.build.csdef 172 | 173 | # Microsoft Azure Emulator 174 | ecf/ 175 | rcf/ 176 | 177 | # Windows Store app package directories and files 178 | AppPackages/ 179 | BundleArtifacts/ 180 | Package.StoreAssociation.xml 181 | _pkginfo.txt 182 | 183 | # Visual Studio cache files 184 | # files ending in .cache can be ignored 185 | *.[Cc]ache 186 | # but keep track of directories ending in .cache 187 | !*.[Cc]ache/ 188 | 189 | # Others 190 | ClientBin/ 191 | ~$* 192 | *~ 193 | *.dbmdl 194 | *.dbproj.schemaview 195 | *.jfm 196 | *.pfx 197 | *.publishsettings 198 | node_modules/ 199 | orleans.codegen.cs 200 | 201 | # Since there are multiple workflows, uncomment next line to ignore bower_components 202 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 203 | #bower_components/ 204 | 205 | # RIA/Silverlight projects 206 | Generated_Code/ 207 | 208 | # Backup & report files from converting an old project file 209 | # to a newer Visual Studio version. Backup files are not needed, 210 | # because we have git ;-) 211 | _UpgradeReport_Files/ 212 | Backup*/ 213 | UpgradeLog*.XML 214 | UpgradeLog*.htm 215 | 216 | # SQL Server files 217 | *.mdf 218 | *.ldf 219 | 220 | # Business Intelligence projects 221 | *.rdl.data 222 | *.bim.layout 223 | *.bim_*.settings 224 | 225 | # Microsoft Fakes 226 | FakesAssemblies/ 227 | 228 | # GhostDoc plugin setting file 229 | *.GhostDoc.xml 230 | 231 | # Node.js Tools for Visual Studio 232 | .ntvs_analysis.dat 233 | 234 | # Visual Studio 6 build log 235 | *.plg 236 | 237 | # Visual Studio 6 workspace options file 238 | *.opt 239 | 240 | # Visual Studio LightSwitch build output 241 | **/*.HTMLClient/GeneratedArtifacts 242 | **/*.DesktopClient/GeneratedArtifacts 243 | **/*.DesktopClient/ModelManifest.xml 244 | **/*.Server/GeneratedArtifacts 245 | **/*.Server/ModelManifest.xml 246 | _Pvt_Extensions 247 | 248 | # Paket dependency manager 249 | .paket/paket.exe 250 | paket-files/ 251 | 252 | # FAKE - F# Make 253 | .fake/ 254 | 255 | # JetBrains Rider 256 | .idea/ 257 | *.sln.iml 258 | 259 | # CodeRush 260 | .cr/ 261 | 262 | # Python Tools for Visual Studio (PTVS) 263 | __pycache__/ 264 | *.pyc -------------------------------------------------------------------------------- /sample/RedisFunctionSample/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # Azure Functions localsettings file 5 | local.settings.json 6 | 7 | # User-specific files 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | [Ll]og/ 27 | 28 | # Visual Studio 2015 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # MSTest test Results 34 | [Tt]est[Rr]esult*/ 35 | [Bb]uild[Ll]og.* 36 | 37 | # NUNIT 38 | *.VisualState.xml 39 | TestResult.xml 40 | 41 | # Build Results of an ATL Project 42 | [Dd]ebugPS/ 43 | [Rr]eleasePS/ 44 | dlldata.c 45 | 46 | # DNX 47 | project.lock.json 48 | project.fragment.lock.json 49 | artifacts/ 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # NCrunch 117 | _NCrunch_* 118 | .*crunch*.local.xml 119 | nCrunchTemp_* 120 | 121 | # MightyMoose 122 | *.mm.* 123 | AutoTest.Net/ 124 | 125 | # Web workbench (sass) 126 | .sass-cache/ 127 | 128 | # Installshield output folder 129 | [Ee]xpress/ 130 | 131 | # DocProject is a documentation generator add-in 132 | DocProject/buildhelp/ 133 | DocProject/Help/*.HxT 134 | DocProject/Help/*.HxC 135 | DocProject/Help/*.hhc 136 | DocProject/Help/*.hhk 137 | DocProject/Help/*.hhp 138 | DocProject/Help/Html2 139 | DocProject/Help/html 140 | 141 | # Click-Once directory 142 | publish/ 143 | 144 | # Publish Web Output 145 | *.[Pp]ublish.xml 146 | *.azurePubxml 147 | # TODO: Comment the next line if you want to checkin your web deploy settings 148 | # but database connection strings (with potential passwords) will be unencrypted 149 | #*.pubxml 150 | *.publishproj 151 | 152 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 153 | # checkin your Azure Web App publish settings, but sensitive information contained 154 | # in these scripts will be unencrypted 155 | PublishScripts/ 156 | 157 | # NuGet Packages 158 | *.nupkg 159 | # The packages folder can be ignored because of Package Restore 160 | **/packages/* 161 | # except build/, which is used as an MSBuild target. 162 | !**/packages/build/ 163 | # Uncomment if necessary however generally it will be regenerated when needed 164 | #!**/packages/repositories.config 165 | # NuGet v3's project.json files produces more ignoreable files 166 | *.nuget.props 167 | *.nuget.targets 168 | 169 | # Microsoft Azure Build Output 170 | csx/ 171 | *.build.csdef 172 | 173 | # Microsoft Azure Emulator 174 | ecf/ 175 | rcf/ 176 | 177 | # Windows Store app package directories and files 178 | AppPackages/ 179 | BundleArtifacts/ 180 | Package.StoreAssociation.xml 181 | _pkginfo.txt 182 | 183 | # Visual Studio cache files 184 | # files ending in .cache can be ignored 185 | *.[Cc]ache 186 | # but keep track of directories ending in .cache 187 | !*.[Cc]ache/ 188 | 189 | # Others 190 | ClientBin/ 191 | ~$* 192 | *~ 193 | *.dbmdl 194 | *.dbproj.schemaview 195 | *.jfm 196 | *.pfx 197 | *.publishsettings 198 | node_modules/ 199 | orleans.codegen.cs 200 | 201 | # Since there are multiple workflows, uncomment next line to ignore bower_components 202 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 203 | #bower_components/ 204 | 205 | # RIA/Silverlight projects 206 | Generated_Code/ 207 | 208 | # Backup & report files from converting an old project file 209 | # to a newer Visual Studio version. Backup files are not needed, 210 | # because we have git ;-) 211 | _UpgradeReport_Files/ 212 | Backup*/ 213 | UpgradeLog*.XML 214 | UpgradeLog*.htm 215 | 216 | # SQL Server files 217 | *.mdf 218 | *.ldf 219 | 220 | # Business Intelligence projects 221 | *.rdl.data 222 | *.bim.layout 223 | *.bim_*.settings 224 | 225 | # Microsoft Fakes 226 | FakesAssemblies/ 227 | 228 | # GhostDoc plugin setting file 229 | *.GhostDoc.xml 230 | 231 | # Node.js Tools for Visual Studio 232 | .ntvs_analysis.dat 233 | 234 | # Visual Studio 6 build log 235 | *.plg 236 | 237 | # Visual Studio 6 workspace options file 238 | *.opt 239 | 240 | # Visual Studio LightSwitch build output 241 | **/*.HTMLClient/GeneratedArtifacts 242 | **/*.DesktopClient/GeneratedArtifacts 243 | **/*.DesktopClient/ModelManifest.xml 244 | **/*.Server/GeneratedArtifacts 245 | **/*.Server/ModelManifest.xml 246 | _Pvt_Extensions 247 | 248 | # Paket dependency manager 249 | .paket/paket.exe 250 | paket-files/ 251 | 252 | # FAKE - F# Make 253 | .fake/ 254 | 255 | # JetBrains Rider 256 | .idea/ 257 | *.sln.iml 258 | 259 | # CodeRush 260 | .cr/ 261 | 262 | # Python Tools for Visual Studio (PTVS) 263 | __pycache__/ 264 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Unity.IntegrationTests.MisconfiguredTarget/.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # Azure Functions localsettings file 5 | local.settings.json 6 | 7 | # User-specific files 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | [Ll]og/ 27 | 28 | # Visual Studio 2015 cache/options directory 29 | .vs/ 30 | # Uncomment if you have tasks that create the project's static files in wwwroot 31 | #wwwroot/ 32 | 33 | # MSTest test Results 34 | [Tt]est[Rr]esult*/ 35 | [Bb]uild[Ll]og.* 36 | 37 | # NUNIT 38 | *.VisualState.xml 39 | TestResult.xml 40 | 41 | # Build Results of an ATL Project 42 | [Dd]ebugPS/ 43 | [Rr]eleasePS/ 44 | dlldata.c 45 | 46 | # DNX 47 | project.lock.json 48 | project.fragment.lock.json 49 | artifacts/ 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # NCrunch 117 | _NCrunch_* 118 | .*crunch*.local.xml 119 | nCrunchTemp_* 120 | 121 | # MightyMoose 122 | *.mm.* 123 | AutoTest.Net/ 124 | 125 | # Web workbench (sass) 126 | .sass-cache/ 127 | 128 | # Installshield output folder 129 | [Ee]xpress/ 130 | 131 | # DocProject is a documentation generator add-in 132 | DocProject/buildhelp/ 133 | DocProject/Help/*.HxT 134 | DocProject/Help/*.HxC 135 | DocProject/Help/*.hhc 136 | DocProject/Help/*.hhk 137 | DocProject/Help/*.hhp 138 | DocProject/Help/Html2 139 | DocProject/Help/html 140 | 141 | # Click-Once directory 142 | publish/ 143 | 144 | # Publish Web Output 145 | *.[Pp]ublish.xml 146 | *.azurePubxml 147 | # TODO: Comment the next line if you want to checkin your web deploy settings 148 | # but database connection strings (with potential passwords) will be unencrypted 149 | #*.pubxml 150 | *.publishproj 151 | 152 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 153 | # checkin your Azure Web App publish settings, but sensitive information contained 154 | # in these scripts will be unencrypted 155 | PublishScripts/ 156 | 157 | # NuGet Packages 158 | *.nupkg 159 | # The packages folder can be ignored because of Package Restore 160 | **/packages/* 161 | # except build/, which is used as an MSBuild target. 162 | !**/packages/build/ 163 | # Uncomment if necessary however generally it will be regenerated when needed 164 | #!**/packages/repositories.config 165 | # NuGet v3's project.json files produces more ignoreable files 166 | *.nuget.props 167 | *.nuget.targets 168 | 169 | # Microsoft Azure Build Output 170 | csx/ 171 | *.build.csdef 172 | 173 | # Microsoft Azure Emulator 174 | ecf/ 175 | rcf/ 176 | 177 | # Windows Store app package directories and files 178 | AppPackages/ 179 | BundleArtifacts/ 180 | Package.StoreAssociation.xml 181 | _pkginfo.txt 182 | 183 | # Visual Studio cache files 184 | # files ending in .cache can be ignored 185 | *.[Cc]ache 186 | # but keep track of directories ending in .cache 187 | !*.[Cc]ache/ 188 | 189 | # Others 190 | ClientBin/ 191 | ~$* 192 | *~ 193 | *.dbmdl 194 | *.dbproj.schemaview 195 | *.jfm 196 | *.pfx 197 | *.publishsettings 198 | node_modules/ 199 | orleans.codegen.cs 200 | 201 | # Since there are multiple workflows, uncomment next line to ignore bower_components 202 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 203 | #bower_components/ 204 | 205 | # RIA/Silverlight projects 206 | Generated_Code/ 207 | 208 | # Backup & report files from converting an old project file 209 | # to a newer Visual Studio version. Backup files are not needed, 210 | # because we have git ;-) 211 | _UpgradeReport_Files/ 212 | Backup*/ 213 | UpgradeLog*.XML 214 | UpgradeLog*.htm 215 | 216 | # SQL Server files 217 | *.mdf 218 | *.ldf 219 | 220 | # Business Intelligence projects 221 | *.rdl.data 222 | *.bim.layout 223 | *.bim_*.settings 224 | 225 | # Microsoft Fakes 226 | FakesAssemblies/ 227 | 228 | # GhostDoc plugin setting file 229 | *.GhostDoc.xml 230 | 231 | # Node.js Tools for Visual Studio 232 | .ntvs_analysis.dat 233 | 234 | # Visual Studio 6 build log 235 | *.plg 236 | 237 | # Visual Studio 6 workspace options file 238 | *.opt 239 | 240 | # Visual Studio LightSwitch build output 241 | **/*.HTMLClient/GeneratedArtifacts 242 | **/*.DesktopClient/GeneratedArtifacts 243 | **/*.DesktopClient/ModelManifest.xml 244 | **/*.Server/GeneratedArtifacts 245 | **/*.Server/ModelManifest.xml 246 | _Pvt_Extensions 247 | 248 | # Paket dependency manager 249 | .paket/paket.exe 250 | paket-files/ 251 | 252 | # FAKE - F# Make 253 | .fake/ 254 | 255 | # JetBrains Rider 256 | .idea/ 257 | *.sln.iml 258 | 259 | # CodeRush 260 | .cr/ 261 | 262 | # Python Tools for Visual Studio (PTVS) 263 | __pycache__/ 264 | *.pyc -------------------------------------------------------------------------------- /test/Indigo.Functions.Redis.IntegrationTests/RedisAttributeTests.cs: -------------------------------------------------------------------------------- 1 | using Indigo.Functions.Redis.IntegrationTests.Target; 2 | using Newtonsoft.Json; 3 | using StackExchange.Redis; 4 | using System; 5 | using System.IO; 6 | using System.Net.Http; 7 | using System.Threading.Tasks; 8 | using Xunit; 9 | 10 | namespace Indigo.Functions.Redis.IntegrationTests 11 | { 12 | public class RedisAttributeTests 13 | { 14 | private static readonly HttpClient httpClient = new HttpClient(); 15 | private readonly Lazy> _database; 16 | 17 | public RedisAttributeTests() 18 | { 19 | _database = new Lazy>(async () => 20 | { 21 | var connectionMultiplexer = await ConnectionMultiplexer 22 | .ConnectAsync("localhost") 23 | .ConfigureAwait(false); 24 | return connectionMultiplexer.GetDatabase(); 25 | }); 26 | } 27 | 28 | [Fact] 29 | public async Task Redis_GetMultiplexer_EnsureSharedInstance() 30 | { 31 | // Act 32 | var response1 = await httpClient.GetAsync($"http://localhost:7075/test/resource/multiplexer1"); 33 | var response2 = await httpClient.GetAsync($"http://localhost:7075/test/resource/multiplexer2"); 34 | 35 | // Assert 36 | var hashCode1 = await response1.Content.ReadAsStringAsync(); 37 | var hashCode2 = await response2.Content.ReadAsStringAsync(); 38 | Assert.Equal(hashCode1, hashCode2); 39 | } 40 | 41 | [Fact] 42 | public async Task Redis_GetMultiplexer_ValueReadFromRedis() 43 | { 44 | // Arrange 45 | var key = Path.GetRandomFileName(); 46 | var value = Path.GetRandomFileName(); 47 | var database = await _database.Value; 48 | await database.StringSetAsync(key, value); 49 | 50 | // Act 51 | var response = await httpClient.GetAsync($"http://localhost:7075/test/multiplexer/{key}"); 52 | 53 | // Assert 54 | var actualValue = await response.Content.ReadAsStringAsync(); 55 | Assert.Equal(value, actualValue); 56 | } 57 | 58 | [Fact] 59 | public async Task Redis_GetMultiplexerAsync_ValueReadFromRedis() 60 | { 61 | // Arrange 62 | var key = Path.GetRandomFileName(); 63 | var value = Path.GetRandomFileName(); 64 | var database = await _database.Value; 65 | await database.StringSetAsync(key, value); 66 | 67 | // Act 68 | var response = await httpClient.GetAsync($"http://localhost:7075/test/multiplexerasync/{key}"); 69 | 70 | // Assert 71 | var actualValue = await response.Content.ReadAsStringAsync(); 72 | Assert.Equal(value, actualValue); 73 | } 74 | 75 | [Fact] 76 | public async Task Redis_GetDatabase_ValueReadFromRedis() 77 | { 78 | // Arrange 79 | var key = Path.GetRandomFileName(); 80 | var value = Path.GetRandomFileName(); 81 | var database = await _database.Value; 82 | await database.StringSetAsync(key, value); 83 | 84 | // Act 85 | var response = await httpClient.GetAsync($"http://localhost:7075/test/database/{key}"); 86 | 87 | // Assert 88 | var actualValue = await response.Content.ReadAsStringAsync(); 89 | Assert.Equal(value, actualValue); 90 | } 91 | 92 | [Fact] 93 | public async Task Redis_GetDatabaseAsync_ValueReadFromRedis() 94 | { 95 | // Arrange 96 | var key = Path.GetRandomFileName(); 97 | var value = Path.GetRandomFileName(); 98 | var database = await _database.Value; 99 | await database.StringSetAsync(key, value); 100 | 101 | // Act 102 | var response = await httpClient.GetAsync($"http://localhost:7075/test/databaseasync/{key}"); 103 | 104 | // Assert 105 | var actualValue = await response.Content.ReadAsStringAsync(); 106 | Assert.Equal(value, actualValue); 107 | } 108 | 109 | [Fact] 110 | public async Task Redis_GetStringValue_ValueReadFromRedis() 111 | { 112 | // Arrange 113 | var key = Path.GetRandomFileName(); 114 | var value = Path.GetRandomFileName(); 115 | var database = await _database.Value; 116 | await database.StringSetAsync(key, value); 117 | 118 | // Act 119 | var response = await httpClient.GetAsync($"http://localhost:7075/test/string/{key}"); 120 | 121 | // Assert 122 | var actualValue = await response.Content.ReadAsStringAsync(); 123 | Assert.Equal(value, actualValue); 124 | } 125 | 126 | [Fact] 127 | public async Task Redis_SetStringValue_ValueSetInRedis() 128 | { 129 | // Arrange 130 | var key = Path.GetRandomFileName(); 131 | var value = Path.GetRandomFileName(); 132 | 133 | // Act 134 | var response = 135 | await httpClient.PostAsync($"http://localhost:7075/test/string/{key}", new StringContent(value)); 136 | 137 | // Assert 138 | var database = await _database.Value; 139 | var actualValue = await database.StringGetAsync(key); 140 | Assert.Equal(value, actualValue); 141 | } 142 | 143 | [Fact] 144 | public async Task Redis_GetPocoValue_ValueReadFromRedis() 145 | { 146 | // Arrange 147 | var key = Path.GetRandomFileName(); 148 | var expectedObject = new CustomObject() 149 | { 150 | IntegerProperty = new Random().Next(), 151 | StringProperty = Path.GetRandomFileName(), 152 | }; 153 | var database = await _database.Value; 154 | await database.StringSetAsync(key, JsonConvert.SerializeObject(expectedObject)); 155 | 156 | // Act 157 | var response = await httpClient.GetAsync($"http://localhost:7075/test/poco/{key}"); 158 | var content = await response.Content.ReadAsStringAsync(); 159 | 160 | // Assert 161 | var actualObject = JsonConvert.DeserializeObject(content); 162 | Assert.Equal(expectedObject.IntegerProperty, actualObject.IntegerProperty); 163 | Assert.Equal(expectedObject.StringProperty, actualObject.StringProperty); 164 | } 165 | 166 | [Fact] 167 | public async Task Redis_InvalidPocoStored_NullFetched() 168 | { 169 | // Arrange 170 | var key = Path.GetRandomFileName(); 171 | var database = await _database.Value; 172 | await database.StringSetAsync(key, Path.GetRandomFileName()); 173 | 174 | // Act 175 | var response = await httpClient.GetAsync($"http://localhost:7075/test/poco/{key}"); 176 | var content = await response.Content.ReadAsStringAsync(); 177 | 178 | // Assert 179 | var actualObject = JsonConvert.DeserializeObject(content); 180 | Assert.Null(actualObject); 181 | } 182 | 183 | [Fact] 184 | public async Task Redis_SetPocoValue_ValueReadFromRedis() 185 | { 186 | // Arrange 187 | var key = Path.GetRandomFileName(); 188 | var expectedObject = new CustomObject() 189 | { 190 | IntegerProperty = new Random().Next(), 191 | StringProperty = Path.GetRandomFileName(), 192 | }; 193 | 194 | // Act 195 | var response = await httpClient.PostAsync($"http://localhost:7075/test/poco/{key}", 196 | new StringContent(JsonConvert.SerializeObject(expectedObject))); 197 | var content = await response.Content.ReadAsStringAsync(); 198 | 199 | // Assert 200 | var database = await _database.Value; 201 | var actualValue = await database.StringGetAsync(key); 202 | var actualObject = JsonConvert.DeserializeObject(content); 203 | Assert.Equal(expectedObject.IntegerProperty, actualObject.IntegerProperty); 204 | Assert.Equal(expectedObject.StringProperty, actualObject.StringProperty); 205 | } 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /test/Indigo.Functions.Configuration.IntegrationTests.Target/Function.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using Microsoft.AspNetCore.Mvc; 3 | using Microsoft.Azure.WebJobs; 4 | using Microsoft.Azure.WebJobs.Extensions.Http; 5 | using Microsoft.Azure.WebJobs.Host; 6 | using System; 7 | using System.Globalization; 8 | 9 | namespace Indigo.Functions.Configuration.IntegrationTests.Target 10 | { 11 | public static class Function 12 | { 13 | [FunctionName("NoSettingNameFunction")] 14 | public static IActionResult NoSettingNameFunction( 15 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "NoSettingName")] HttpRequest req, 16 | [Config] string value, 17 | TraceWriter log) 18 | { 19 | return new OkObjectResult($"Parsed {value}"); 20 | } 21 | 22 | [FunctionName("BoolFunction")] 23 | public static IActionResult BoolFunction( 24 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Bool")] HttpRequest req, 25 | [Config("Bool")] bool value, 26 | TraceWriter log) 27 | { 28 | if (value != true) 29 | { 30 | throw new ArgumentException("Couldn't parse the value"); 31 | } 32 | return new OkObjectResult($"Parsed {value}"); 33 | } 34 | 35 | [FunctionName("ByteFunction")] 36 | public static IActionResult ByteFunction( 37 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Byte")] HttpRequest req, 38 | [Config("Byte")] Byte value, 39 | TraceWriter log) 40 | { 41 | if (value != Byte.MaxValue) 42 | { 43 | throw new ArgumentException("Couldn't parse the value"); 44 | } 45 | return new OkObjectResult($"Parsed {value}"); 46 | } 47 | 48 | [FunctionName("SByteFunction")] 49 | public static IActionResult SByteFunction( 50 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "SByte")] HttpRequest req, 51 | [Config("SByte")] SByte value, 52 | TraceWriter log) 53 | { 54 | if (value != SByte.MaxValue) 55 | { 56 | throw new ArgumentException("Couldn't parse the value"); 57 | } 58 | return new OkObjectResult($"Parsed {value}"); 59 | } 60 | 61 | [FunctionName("CharFunction")] 62 | public static IActionResult CharFunction( 63 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Char")] HttpRequest req, 64 | [Config("Char")] Char value, 65 | TraceWriter log) 66 | { 67 | if (value != 'X') 68 | { 69 | throw new ArgumentException("Couldn't parse the value"); 70 | } 71 | return new OkObjectResult($"Parsed {value}"); 72 | } 73 | 74 | [FunctionName("DateTimeFunction")] 75 | public static IActionResult DateTimeFunction( 76 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "DateTime")] HttpRequest req, 77 | [Config("DateTime")] DateTime value, 78 | TraceWriter log) 79 | { 80 | if (value != DateTime.Parse("2018-4-13 14:00:00", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal)) 81 | { 82 | throw new ArgumentException("Couldn't parse the value"); 83 | } 84 | return new OkObjectResult($"Parsed {value}"); 85 | } 86 | 87 | [FunctionName("DateTimeOffsetFunction")] 88 | public static IActionResult DateTimeOffsetFunction( 89 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "DateTimeOffset")] HttpRequest req, 90 | [Config("DateTimeOffset")] DateTimeOffset value, 91 | TraceWriter log) 92 | { 93 | if (value != DateTimeOffset.Parse("2018-4-13 14:00:00", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal)) 94 | { 95 | throw new ArgumentException("Couldn't parse the value"); 96 | } 97 | return new OkObjectResult($"Parsed {value}"); 98 | } 99 | 100 | [FunctionName("DecimalFunction")] 101 | public static IActionResult DecimalFunction( 102 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Decimal")] HttpRequest req, 103 | [Config("Decimal")] Decimal value, 104 | TraceWriter log) 105 | { 106 | if (value != Decimal.MaxValue) 107 | { 108 | throw new ArgumentException("Couldn't parse the value"); 109 | } 110 | return new OkObjectResult($"Parsed {value}"); 111 | } 112 | 113 | [FunctionName("DoubleFunction")] 114 | public static IActionResult DoubleFunction( 115 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Double")] HttpRequest req, 116 | [Config("Double")] Double value, 117 | TraceWriter log) 118 | { 119 | if (value != 12345.67890123456) 120 | { 121 | throw new ArgumentException("Couldn't parse the value"); 122 | } 123 | return new OkObjectResult($"Parsed {value}"); 124 | } 125 | 126 | [FunctionName("FloatFunction")] 127 | public static IActionResult FloatFunction( 128 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Float")] HttpRequest req, 129 | [Config("Float")] float value, 130 | TraceWriter log) 131 | { 132 | if (value != 123.456789f) 133 | { 134 | throw new ArgumentException("Couldn't parse the value"); 135 | } 136 | return new OkObjectResult($"Parsed {value}"); 137 | } 138 | 139 | [FunctionName("GuidFunction")] 140 | public static IActionResult GuidFunction( 141 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Guid")] HttpRequest req, 142 | [Config("Guid")] Guid value, 143 | TraceWriter log) 144 | { 145 | if (value != Guid.Parse("e20f2d60-3174-433f-a817-1131e9338978")) 146 | { 147 | throw new ArgumentException("Couldn't parse the value"); 148 | } 149 | return new OkObjectResult($"Parsed {value}"); 150 | } 151 | 152 | [FunctionName("IntFunction")] 153 | public static IActionResult IntFunction( 154 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Int")] HttpRequest req, 155 | [Config("Int")] int value, 156 | TraceWriter log) 157 | { 158 | if (value != int.MaxValue) 159 | { 160 | throw new ArgumentException("Couldn't parse the value"); 161 | } 162 | return new OkObjectResult($"Parsed {value}"); 163 | } 164 | 165 | [FunctionName("UintFunction")] 166 | public static IActionResult UintFunction( 167 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Uint")] HttpRequest req, 168 | [Config("Uint")] uint value, 169 | TraceWriter log) 170 | { 171 | if (value != uint.MaxValue) 172 | { 173 | throw new ArgumentException("Couldn't parse the value"); 174 | } 175 | return new OkObjectResult($"Parsed {value}"); 176 | } 177 | 178 | [FunctionName("LongFunction")] 179 | public static IActionResult LongFunction( 180 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Long")] HttpRequest req, 181 | [Config("Long")] long value, 182 | TraceWriter log) 183 | { 184 | if (value != long.MaxValue) 185 | { 186 | throw new ArgumentException("Couldn't parse the value"); 187 | } 188 | return new OkObjectResult($"Parsed {value}"); 189 | } 190 | 191 | [FunctionName("ULongFunction")] 192 | public static IActionResult ULongFunction( 193 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "ULong")] HttpRequest req, 194 | [Config("ULong")] ulong value, 195 | TraceWriter log) 196 | { 197 | if (value != ulong.MaxValue) 198 | { 199 | throw new ArgumentException("Couldn't parse the value"); 200 | } 201 | return new OkObjectResult($"Parsed {value}"); 202 | } 203 | 204 | [FunctionName("ShortFunction")] 205 | public static IActionResult ShortFunction( 206 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "Short")] HttpRequest req, 207 | [Config("Short")] short value, 208 | TraceWriter log) 209 | { 210 | if (value != short.MaxValue) 211 | { 212 | throw new ArgumentException("Couldn't parse the value"); 213 | } 214 | return new OkObjectResult($"Parsed {value}"); 215 | } 216 | 217 | [FunctionName("UShortFunction")] 218 | public static IActionResult UShortFunction( 219 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "UShort")] HttpRequest req, 220 | [Config("UShort")] ushort value, 221 | TraceWriter log) 222 | { 223 | if (value != ushort.MaxValue) 224 | { 225 | throw new ArgumentException("Couldn't parse the value"); 226 | } 227 | return new OkObjectResult($"Parsed {value}"); 228 | } 229 | 230 | [FunctionName("StringFunction")] 231 | public static IActionResult StringFunction( 232 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "String")] HttpRequest req, 233 | [Config("String")] String value, 234 | TraceWriter log) 235 | { 236 | if (value != "abc") 237 | { 238 | throw new ArgumentException("Couldn't parse the value"); 239 | } 240 | return new OkObjectResult($"Parsed {value}"); 241 | } 242 | 243 | [FunctionName("TimespanFunction")] 244 | public static IActionResult TimeSpanFunction( 245 | [HttpTrigger(AuthorizationLevel.Function, "GET", Route = "TimeSpan")] HttpRequest req, 246 | [Config("TimeSpan")] TimeSpan value, 247 | TraceWriter log) 248 | { 249 | if (value !=TimeSpan 250 | .FromDays(6) 251 | .Add(TimeSpan.FromHours(12)) 252 | .Add(TimeSpan.FromMinutes(14)) 253 | .Add(TimeSpan.FromSeconds(45))) 254 | { 255 | throw new ArgumentException("Couldn't parse the value"); 256 | } 257 | return new OkObjectResult($"Parsed {value}"); 258 | } 259 | } 260 | } 261 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Indigo Functions 2 | *Write better Azure Functions* 3 | 4 | ![runtime](https://img.shields.io/badge/Azure%20Functions-v2-orange.svg) 5 | [![license](https://img.shields.io/github/license/mashape/apistatus.svg)](https://github.com/daulet/Indigo.Functions) 6 | 7 | This project aims at increasing usabiltiy of [Azure Functions](https://azure.microsoft.com/en-us/blog/introducing-azure-functions/) in real life applications with usage of custom input and output [bindings](https://github.com/Azure/azure-webjobs-sdk-extensions/wiki/Binding-Extensions-Overview). Azure Functions come with [built in support](https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings) for some triggers, inputs and outputs, mainly for Azure services like Cosmos DB, Azure Storage, Event Grid, Microsoft Graph etc. However, mature applications require more than just that: some sort of dependency injection for testability purposes; use of non-Azure services, like Redis; configurable parameters that are not hardcoded into the function. Custom input and output bindings provided by this project solve these problems in native Azure Functions way. 8 | 9 | | Binding | Purpose | Sample | Nuget | 10 | | ------- | ------- | ------ |:-----:| 11 | | ```[Config("key")]``` | [Configuration](#configuration) via Application Settings | [ConfigurationFunction](sample/ConfigurationFunctionSample) | [![Nuget version](https://img.shields.io/nuget/dt/Indigo.Functions.Configuration.svg)](https://www.nuget.org/packages/Indigo.Functions.Configuration) | 12 | | ```[Inject]``` | [Dependency Injection](#dependency-injection) with [Autofac](#autofac) | [AutofacFunction](sample/AutofacFunctionSample) | [![Nuget version](https://img.shields.io/nuget/dt/Indigo.Functions.Autofac.svg)](https://www.nuget.org/packages/Indigo.Functions.Autofac) | 13 | | ```[Inject]``` | [Dependency Injection](#dependency-injection) with [built-in .NET Core container](#servicecollection) | [InjectionFunction](sample/InjectionFunctionSample) | [![Nuget version](https://img.shields.io/nuget/dt/Indigo.Functions.Injection.svg)](https://www.nuget.org/packages/Indigo.Functions.Injection) | 14 | | ```[Inject]``` | [Dependency Injection](#dependency-injection) with [Unity](#unity) containers | [UnityFunction](sample/UnityFunctionSample) | [![Nuget version](https://img.shields.io/nuget/dt/Indigo.Functions.Unity.svg)](https://www.nuget.org/packages/Indigo.Functions.Unity) | 15 | | ```[Redis("key")]``` | [Redis](#redis) input and output with POCO support | [RedisFunction](sample/RedisFunctionSample) | [![Nuget version](https://img.shields.io/nuget/dt/Indigo.Functions.Redis.svg)](https://www.nuget.org/packages/Indigo.Functions.Redis) | 16 | 17 | ## Dependency Injection 18 | 19 | Use [Inject] attribute to inject all your dependencies in Azure Function declaration. 20 | 21 | ```cs 22 | [FunctionName("Example")] 23 | public static IActionResult Run( 24 | [HttpTrigger("GET")] HttpRequest request, 25 | [Inject] IStorageAccess storageAccess) 26 | { 27 | ... 28 | } 29 | ``` 30 | 31 | [Microsoft.Extensions.Configuration.IConfiguration](https://docs.microsoft.com/en-us/dotnet/api/microsoft.extensions.configuration.iconfiguration) instance is pre-registered for your convinience that you can use to read settings from [local settings file](https://docs.microsoft.com/en-us/azure/azure-functions/functions-run-local#local-settings-file) or [application settings](https://docs.microsoft.com/en-us/azure/azure-functions/functions-how-to-use-azure-function-app-settings#settings) depending on whether you running locally or on Azure respectively. In addition, [Microsoft.Extensions.Logging.ILogger](https://github.com/Azure/azure-functions-host/wiki/ILogger) instance is also pre-registered for you to log to file system and App Insights. Just declare it as dependency in your implementation class anywhere in your dependency tree. 32 | 33 | ```cs 34 | using Microsoft.Extensions.Configuration; 35 | using Microsoft.Extensions.Logging; 36 | 37 | public class ValueProvider 38 | { 39 | public ValueProvider(IConfiguration configuration, ILogger logger) 40 | { 41 | _configuration = configuration; 42 | _logger = logger; 43 | } 44 | 45 | public string ReadSetting(string settingName) 46 | { 47 | _logger.LogInformation($"Reading value of '{settingName}'"); 48 | 49 | return _configuration[settingName]; 50 | } 51 | 52 | ... 53 | } 54 | ``` 55 | 56 | Supported IoC containers: 57 | 58 | * [Autofac](#autofac) 59 | * [.NET Core's ServiceCollection](#servicecollection) 60 | * [Unity container](#unity) 61 | 62 | ### Autofac 63 | 64 | [![Nuget version](https://img.shields.io/nuget/v/Indigo.Functions.Autofac.svg)](https://www.nuget.org/packages/Indigo.Functions.Autofac) 65 | [![Nuget downloads](https://img.shields.io/nuget/dt/Indigo.Functions.Autofac.svg)](https://www.nuget.org/packages/Indigo.Functions.Autofac) 66 | 67 | Create implementation of *IDependencyConfig* interface (public visibility) in your function's binary: 68 | 69 | ```cs 70 | public class DependencyConfig : IDependencyConfig 71 | { 72 | public void RegisterComponents(ContainerBuilder builder) 73 | { 74 | builder 75 | .RegisterType() 76 | .As(); 77 | } 78 | } 79 | ``` 80 | 81 | For further details see [working sample](sample/AutofacFunctionSample) or [function declarations in tests](test/Indigo.Functions.Autofac.IntegrationTests.Target). 82 | 83 | ### ServiceCollection 84 | 85 | [![Nuget version](https://img.shields.io/nuget/v/Indigo.Functions.Injection.svg)](https://www.nuget.org/packages/Indigo.Functions.Injection) 86 | [![Nuget downloads](https://img.shields.io/nuget/dt/Indigo.Functions.Injection.svg)](https://www.nuget.org/packages/Indigo.Functions.Injection) 87 | 88 | Register all your dependencies in Startup class: 89 | 90 | ```cs 91 | [assembly: WebJobsStartup(typeof(InjectionFunctionSample.Startup))] 92 | namespace InjectionFunctionSample 93 | { 94 | public class Startup : IWebJobsStartup 95 | { 96 | public void Configure(IWebJobsBuilder builder) 97 | { 98 | builder.Services.AddSingleton(); 99 | builder.Services.AddTransient(); 100 | builder.Services.AddTransient(); 101 | builder.Services.AddTransient(); 102 | } 103 | } 104 | } 105 | ``` 106 | 107 | For further details see [working sample](sample/InjectionFunctionSample) or [function declarations in tests](test/Indigo.Functions.Injection.IntegrationTests.Target). For details on how to use ASP.NET Core's ServiceCollection see [official guide](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection). 108 | 109 | ### Unity 110 | 111 | [![Nuget version](https://img.shields.io/nuget/v/Indigo.Functions.Unity.svg)](https://www.nuget.org/packages/Indigo.Functions.Unity) 112 | [![Nuget downloads](https://img.shields.io/nuget/dt/Indigo.Functions.Unity.svg)](https://www.nuget.org/packages/Indigo.Functions.Unity) 113 | 114 | Create implementation of *IDependencyConfig* interface (public visibility) in your function's binary: 115 | 116 | ```cs 117 | public class DependencyInjectionConfig : IDependencyConfig 118 | { 119 | public void RegisterComponents(UnityContainer container) 120 | { 121 | container.RegisterType(); 122 | } 123 | } 124 | ``` 125 | 126 | For further details see [working sample](sample/UnityFunctionSample) or [function declarations in tests](test/Indigo.Functions.Unity.IntegrationTests.Target). 127 | 128 | ### FAQ 129 | 130 | * What if I need multiple containers for my application? 131 | 132 | *Azure Functions or any Function as a Service is a culmination of decades long effort towards reducing deployment, but more importatnly maintenance complexity by breaking down a monolith into applications to individual functions. So use it right, and separate your other function that needs a different container into a separate binary.* 133 | 134 | ## Configuration 135 | 136 | [![Nuget version](https://img.shields.io/nuget/v/Indigo.Functions.Configuration.svg)](https://www.nuget.org/packages/Indigo.Functions.Configuration) 137 | [![Nuget downloads](https://img.shields.io/nuget/dt/Indigo.Functions.Configuration.svg)](https://www.nuget.org/packages/Indigo.Functions.Configuration) 138 | 139 | Some applications might have pre-production environments that require different set of parameters (settings) to be fed into your application, e.g. integration tests might have more aggressive timeouts or different integration URL for external service. 140 | 141 | ```cs 142 | [FunctionName("ConfigFunctionExample")] 143 | public static IActionResult Run( 144 | [HttpTrigger("GET")] HttpRequest request, 145 | [Config("StringSetting")] string stringValue, 146 | [Config("IntSetting")] int intValue, 147 | [Config("TimeSpanSetting")] TimeSpan timeSpanValue) 148 | { 149 | ... 150 | } 151 | ``` 152 | 153 | [Here](sample/ConfigurationFunctionSample) is a working sample. The binding supports [simple types](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/built-in-types-table) and *string*. In addition, it supports structs like [DateTime](https://docs.microsoft.com/en-us/dotnet/api/system.datetime), [DateTimeOffset](https://docs.microsoft.com/en-us/dotnet/api/system.datetimeoffset), [Guid](https://docs.microsoft.com/en-us/dotnet/api/system.guid) and [TimeSpan](https://docs.microsoft.com/en-us/dotnet/api/system.timespan). A full list of supported types can be found [in integration tests](test/Indigo.Functions.Configuration.IntegrationTests.Target/Function.cs). 154 | 155 | ## Redis 156 | 157 | [![Nuget version](https://img.shields.io/nuget/v/Indigo.Functions.Redis.svg)](https://www.nuget.org/packages/Indigo.Functions.Redis) 158 | [![NuGet downloads](https://img.shields.io/nuget/dt/Indigo.Functions.Redis.svg)](https://www.nuget.org/packages/Indigo.Functions.Redis) 159 | 160 | 161 | *[Redis]* binding enables reading Redis strings: 162 | 163 | ```cs 164 | [FunctionName("GetCachedString")] 165 | public static IActionResult GetString( 166 | [HttpTrigger("GET", Route = "cache/{key}")] HttpRequest request, 167 | [Redis(Key = "{key}")] string cachedValue) 168 | { 169 | return new OkObjectResult(cachedValue); 170 | } 171 | ``` 172 | 173 | OR you can deserialize (JSON) string keys into custom objects: 174 | 175 | ```cs 176 | [FunctionName("GetPoco")] 177 | public static IActionResult GetPoco( 178 | [HttpTrigger("GET", Route = "poco/{key}")] HttpRequest request, 179 | [Redis(Key = "{key}")] CustomObject cachedValue) 180 | { 181 | ... 182 | } 183 | 184 | public class CustomObject 185 | { 186 | public int IntegerProperty { get; set; } 187 | 188 | public string StringProperty { get; set; } 189 | } 190 | ``` 191 | 192 | And of course your can write back to Redis: 193 | 194 | ```cs 195 | [FunctionName("SetPoco")] 196 | public static async Task SetPoco( 197 | [HttpTrigger("POST", Route = "poco/{key}")] HttpRequest request, 198 | [Redis(Key = "{key}")] IAsyncCollector collector) 199 | { 200 | string requestBody; 201 | using (var reader = new StreamReader(request.Body)) 202 | { 203 | requestBody = reader.ReadToEnd(); 204 | var value = JsonConvert.DeserializeObject(requestBody); 205 | await collector.AddAsync(value); 206 | } 207 | return new OkObjectResult(requestBody); 208 | } 209 | ``` 210 | 211 | To configure your Redis connection string set it in *RedisConfigurationOptions* setting. See [working sample](sample/RedisFunctionSample) or [integration tests](test/Indigo.Functions.Redis.IntegrationTests.Target) for full range of functionality. 212 | 213 | ## Real life examples 214 | 215 | This project is a consequence of building [rehttp](https://github.com/daulet/rehttp) service using Azure Functions. I quickly came to realization that in order to build a reliable and maintainable service I was missing DI for unit testability, configurability for intergration testing and Redis POCO to keep my test code clean. 216 | --------------------------------------------------------------------------------