Skip to content

Instantly share code, notes, and snippets.

😄

Atsushi Yokohama beachside-project

😄
Block or report user

Report or block beachside-project

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@beachside-project
beachside-project / azure-pipelines.yml
Last active Oct 25, 2019
Azure Pipelines Sample: Push Nuget Package source on GitHub to Azure Artifact
View azure-pipelines.yml
trigger:
tags:
include:
- v*
branches:
include:
- master
variables:
vmImageOfBuild: windows-2019
@beachside-project
beachside-project / Function1.cs
Created Oct 2, 2019
CustomBindingsSamples.TeamsBinding
View Function1.cs
using CustomBindingsSamples.TeamsBinding;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
namespace FunctionAppSample
{
public class Function1
{
View TeamsOutputBindingFunctionsStartup.cs
using CustomBindingsSamples.TeamsBinding.Startup;
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection;
[assembly: FunctionsStartup(typeof(TeamsOutputBindingFunctionsStartup))]
namespace CustomBindingsSamples.TeamsBinding.Startup
{
public class TeamsOutputBindingFunctionsStartup : FunctionsStartup
{
View FunctionsHostBuilderExtensionsForTeamsBinding.cs
using Microsoft.Azure.Functions.Extensions.DependencyInjection;
using Microsoft.Azure.WebJobs.Host.Config;
using Microsoft.Extensions.DependencyInjection.Extensions;
using System;
using CustomBindingsSamples.TeamsBinding;
// ReSharper disable once CheckNamespace
namespace Microsoft.Extensions.DependencyInjection
{
public static class FunctionsHostBuilderExtensionsForTeamsBinding
@beachside-project
beachside-project / TeamsBindingConverter.cs
Last active Oct 2, 2019
CustomBindingsSamples.TeamsBinding
View TeamsBindingConverter.cs
using Microsoft.Azure.WebJobs;
namespace CustomBindingsSamples.TeamsBinding
{
public class TeamsBindingConverter : IConverter<TeamsAttribute, IAsyncCollector<TeamsMessage>>
{
private readonly TeamsBindingConfigProvider _configProvider;
public TeamsBindingConverter(TeamsBindingConfigProvider configProvider)
{
@beachside-project
beachside-project / TeamsBindingConfigProvider.cs
Created Oct 2, 2019
CustomBindingsSamples.TeamsBinding
View TeamsBindingConfigProvider.cs
using Microsoft.Azure.WebJobs.Host.Bindings;
using Microsoft.Azure.WebJobs.Host.Config;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Net.Http;
namespace CustomBindingsSamples.TeamsBinding
{
public class TeamsBindingConfigProvider : IExtensionConfigProvider
@beachside-project
beachside-project / TeamsBindingAsyncCollector.cs
Created Oct 2, 2019
CustomBindingsSamples.TeamsBinding
View TeamsBindingAsyncCollector.cs
using Microsoft.Azure.WebJobs;
using System.Threading;
using System.Threading.Tasks;
namespace CustomBindingsSamples.TeamsBinding
{
public class TeamsBindingAsyncCollector : IAsyncCollector<TeamsMessage>
{
private readonly TeamsBindingContext _teamsBindingContext;
@beachside-project
beachside-project / TeamsBindingContext.cs
Created Oct 2, 2019
CustomBindingsSamples.TeamsBinding
View TeamsBindingContext.cs
using Microsoft.Extensions.Logging;
using System;
using System.Net.Http;
using System.Threading.Tasks;
namespace CustomBindingsSamples.TeamsBinding
{
public class TeamsBindingContext
{
private readonly HttpClient _httpClient;
@beachside-project
beachside-project / TeamsMessage.cs
Created Oct 2, 2019
CustomBindingsSamples.TeamsBinding
View TeamsMessage.cs
using Newtonsoft.Json;
using Newtonsoft.Json.Serialization;
namespace CustomBindingsSamples.TeamsBinding
{
public class TeamsMessage
{
private readonly JsonSerializerSettings _settings = new JsonSerializerSettings()
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
@beachside-project
beachside-project / TeamsMessageHelper.cs
Created Oct 2, 2019
CustomBindingsSamples.TeamsBinding
View TeamsMessageHelper.cs
public class TeamsMessageHelper
{
private static string BaseJson = "{{\"title\":\"{0}\",\"text\":\"{1}\",\"themeColor\":\"{2}\",\"@context\":\"https://schema.org/extensions\",\"@type\":\"MessageCard\",\"potentialAction\":[{{\"@type\":\"OpenUri\",\"name\":\"View More\",\"targets\":[{{\"os\":\"default\",\"uri\":\"{3}\"}}]}}]}}\n";
public static string GetJson(string title, string text, string linkUri, string themeColor = "0072C6")
{
// TODO: validation
return string.Format(BaseJson, title, text, themeColor, linkUri);
}
}
You can’t perform that action at this time.