View sample-app.csproj
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
... | |
<PropertyGroup> | |
<CopyAllFilesToSingleFolderForMSDeployDependsOn> | |
CustomCollectFiles; | |
$(CopyAllFilesToSingleFolderForMSDeployDependsOn); | |
</CopyAllFilesToSingleFolderForMSDeployDependsOn> |
View simpleTest.spec.js
describe("Una suite es una función", function() { | |
it("y una spec también es una función", function() { | |
expect(true).toBe(true); | |
}); | |
it("cada spec testea un caso", function() { | |
expect(false).not.toBe(true); | |
}); | |
}); |
View global.asax.cs
using System.Web; | |
using System.Web.Mvc; | |
using System.Web.Optimization; | |
using System.Web.Routing; | |
using Samples.App_Start; | |
namespace Samples | |
{ | |
public class MvcApplication : HttpApplication | |
{ |
View AppInsightsConfig.cs
using System.Configuration; | |
using Microsoft.ApplicationInsights.Extensibility; | |
namespace Samples.App_Start | |
{ | |
public static class AppInsightsConfig | |
{ | |
public static void RegisterAppInsights() | |
{ | |
TelemetryConfiguration.Active.InstrumentationKey = |
View My404Filter.cs
using System; | |
using Microsoft.ApplicationInsights.Channel; | |
using Microsoft.ApplicationInsights.DataContracts; | |
using Microsoft.ApplicationInsights.Extensibility; | |
namespace Samples | |
{ | |
public class My404Filter : ITelemetryProcessor | |
{ | |
private ITelemetryProcessor Next { get; set; } |
View index.js
// Importamos la librería underscore.js | |
var _ = require('underscore'); | |
module.exports = function(context) { | |
// Usamos la librería underscore.js que importamos | |
var matched_names = _ | |
.where(context.bindings.myInput.names, {first: 'Juan'}); | |
// El resto del código de nuestra función | |
} |
View index.js
// O se pueden incluir parámetros adicionales como variables de entrada | |
module.exports = function(context, miDisparador, miEntrada, miOtraEntrada) { | |
// la lógica de la función va aquí | |
}; |
View index.js
// Se debe incluir el context, pero los otros argumentos son opcionales | |
module.exports = function(context) { | |
// Las variables de entrada adicionales pueden accederse en la propiedad arguments | |
if(arguments.length === 2) { | |
context.log('La función recibió 2 argumentos de entrada'); | |
} | |
}; |
View run.csx
using System; | |
public static void Run(TimerInfo myTimer, TraceWriter log) | |
{ | |
log.Info($"Función con trigger por timer en C# ejecutada el {DateTime.Now}"); | |
} |
View project.json
{ | |
"frameworks": { | |
"net46":{ | |
"dependencies": { | |
"Microsoft.Azure.Search": "2.0.4-preview" | |
} | |
} | |
} | |
} |
NewerOlder