View SimpleKafkaTriggers.cs
using Avro; | |
using Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.Kafka; | |
using Microsoft.Extensions.Logging; | |
using System; | |
using System.Collections.Generic; | |
using System.Runtime.CompilerServices; | |
using System.Text; | |
using System.Threading.Tasks; |
View devcontainer.json
// For format details, see https://aka.ms/vscode-remote/devcontainer.json or this file's README at: | |
// https://github.com/microsoft/vscode-dev-containers/tree/v0.106.0/containers/azure-functions-node-10 | |
{ | |
"name": "Azure Functions & Python 3 & Confluent Kafka", | |
"dockerComposeFile": "docker-compose.yml", | |
"service": "myfunction", | |
"workspaceFolder": "/workspace", | |
"remoteEnv": {"LD_LIBRARY_PATH": "/workspace/bin/runtimes/linux-x64/native"}, | |
"containerEnv": {"LD_LIBRARY_PATH": "/workspace/bin/runtimes/linux-x64/native"}, | |
"forwardPorts": [ 7071, 9021 ], |
View launch.json
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Attach to Python Functions", | |
"type": "python", | |
"request": "attach", | |
"linux": { | |
"env": [{ "name": "LD_LIBRARY_PATH"}, {"value": "/workspace/bin/runtimes/linux-x64/native"}], | |
}, |
View Main.java
import java.lang.reflect.Method; | |
import java.net.URL; | |
import java.net.URLClassLoader; | |
public class Main { | |
public static void main(String args[]){ | |
try{ | |
String pathToJar = args[0]; | |
System.out.println(pathToJar); | |
URL[] urls = { new URL("jar:file:" + pathToJar+"!/")}; |
View LibrarySample.java
package com.simplearchitect.lib; | |
public class LibrarySample { | |
public void execute() { | |
System.out.println("Hello World from Library."); | |
} | |
} |
View sudoers
# This file MUST be edited with the 'visudo' command as root. | |
# | |
# Please consider adding local content in /etc/sudoers.d/ instead of | |
# directly modifying this file. | |
# | |
# See the man page for details on how to write a sudoers file. | |
# | |
Defaults env_reset | |
Defaults mail_badpass | |
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin" |
View host.json
{ | |
"extensions": { | |
"durableTask": { | |
"tracing": { | |
"DistributedTracingProtocol": "W3CTraceContext" | |
} | |
} | |
}, | |
"logging": { | |
"applicationInsights": { |
View local.settings.json
{ | |
"IsEncrypted": false, | |
"Values": { | |
"AzureWebJobsStorage": "UseDevelopmentStorage=true", | |
"FUNCTIONS_WORKER_RUNTIME": "dotnet", | |
"APPINSIGHTS_INSTRUMENTATIONKEY": "<YOUR_APPINSGITHS_INSTRUMENTATIONKEY_HERE>" | |
} | |
} |
View FunctionAppCorrelation.csproj
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<AzureFunctionsVersion>v3</AzureFunctionsVersion> | |
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis> | |
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask.Telemetry" Version="2.2.0-alpha" /> | |
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="3.0.5" /> |
View SampleTest.java
public class SampleTest { | |
@Test | |
public void executeSample( | |
@Mocked final TypedData data1, | |
@Mocked final TypedData data2 | |
) throws Exception { | |
new Expectations() {{ | |
data1.getName(); result = "foo"; | |
data2.getName(); result = "bar"; | |
}}; |
NewerOlder