This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Runtime.CompilerServices; | |
| using Microsoft.ApplicationInsights; | |
| using Microsoft.ApplicationInsights.DataContracts; | |
| namespace Stuff | |
| { | |
| public class Log | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Collections.Generic; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| using Stuff.Formatters; | |
| using Microsoft.ServiceBus.Messaging; | |
| namespace Stuff.Subscribers | |
| { | |
| public class EventHubSubscriber : SubscriberBase, IAsyncObserver<string> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [{ | |
| "shipmentId": "1Z1234ABC", | |
| "timestamp": "2018-02-01T01:13:45Z", | |
| "status": "Left carrier facility, Seattle WA" | |
| }, | |
| { | |
| "shipmentId": "1Z1234ABC", | |
| "timestamp": "2018-02-01T16:49:17Z", | |
| "status": "Arrived carrier facility, Des Moines IA" | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| param( | |
| [string]$InstallDir = "drive:\path\to\folder\chrome-win32", | |
| [switch]$Verbose = $false | |
| ) | |
| $rootDir = $InstallDir | |
| $latest = Invoke-WebRequest -Uri "https://www.googleapis.com/storage/v1/b/chromium-browser-snapshots/o/Win_x64%2FLAST_CHANGE" -Verbose:$Verbose | |
| $data = ConvertFrom-Json -InputObject $latest.Content | |
| $build = $data.metadata.'cr-commit-position-number' | |
| Write-Host Latest is $build, looking for your version... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net; | |
| using System.Security.Claims; | |
| public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
| { | |
| var stuff = System.Security.Claims.ClaimsPrincipal.Current.Claims.Select(x => new { x.Type, x.Value }); | |
| return req.CreateResponse(HttpStatusCode.OK, stuff); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Net; | |
| using System.Net.Http; | |
| using System.Net.Http.Headers; | |
| using Microsoft.Azure.Services.AppAuthentication; | |
| public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
| { | |
| var target = "<target app client ID>"; | |
| var azureServiceTokenProvider = new AzureServiceTokenProvider(); | |
| string accessToken = await azureServiceTokenProvider.GetAccessTokenAsync(target); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "frameworks":{ | |
| "net46": { | |
| "dependencies": { | |
| "Microsoft.Azure.Services.AppAuthentication": "1.1.0-preview" | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # you may not need tenantId, but if it is ambiguous you should set it here | |
| Connect-AzureAd -TenantId | |
| # name of your MSI service principal, in my case msi-func. You can also get the ID from Enterprise Applications in AAD (not App Reg) | |
| $msifunc = Get-AzureADServicePrincipal -SearchString "msi-func" | |
| # name of your AAD service principal, in my case aad-func. You can also get the ID from App Registrations in AAD | |
| $aadapp = Get-AzureADServicePrincipal -SearchString "aad-func" | |
| # Id - the ID of the role. You can get it from the app's manifest | |
| # PrincipalId - the object ID of the MSI principal | |
| # ObjectId - the object ID of the MSI principal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <Project Sdk="Microsoft.NET.Sdk"> | |
| <PropertyGroup> | |
| <TargetFramework>netstandard2.0</TargetFramework> | |
| </PropertyGroup> | |
| <ItemGroup> | |
| <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.0.0" /> | |
| <PackageReference Include="Microsoft.IdentityModel.Clients.ActiveDirectory" Version="3.19.8" /> | |
| </ItemGroup> | |
| </Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Contact | |
| { | |
| [JsonProperty("name")] | |
| public string Name { get; set; } | |
| [JsonProperty("email")] | |
| public string Email { get; set; } | |
| } |