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][parameter(Mandatory = $true)] $keyVaultName | |
) | |
$keyVaultAccessPolicies = (Get-AzureRMKeyVault -VaultName $keyVaultName).accessPolicies | |
$armAccessPolicies = @() | |
if($keyVaultAccessPolicies) | |
{ |
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
[ | |
{ | |
"apiVersion": "2016-10-01", | |
"location": "[parameters('location')]", | |
"name": "[variables('keyVaultName')]", | |
"properties": { | |
"enabledForDeployment": false, | |
"enabledForDiskEncryption": false, | |
"enabledForTemplateDeployment": true, | |
"tenantId": "[subscription().tenantId]", |
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
#r "System.Security" | |
using System.Net; | |
using System.Text; | |
using System.Security.Cryptography; | |
private const string Sha1Prefix = "sha1="; | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info("C# HTTP trigger function processed a request."); |
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
[<Fact>] | |
let ``filter emit only those items from an observable that pass a predicate test`` () = | |
TestSchedule.usage <| fun sch -> | |
let stub = cold "--2-(30)--(22)-5--(60)-1--|" sch | |
let expected = "-- -(30)--(22)- --(60)- --|" | |
stub |> Observable.filter (fun x -> int x > 10) | |
|> Marbles.expectMessages sch expected |
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
let stubQueryParams = | |
[ "category", Arb.generate<string> | |
"style", Arb.generate<string> | |
"size", Arb.generate<string> ] | |
|> Map.ofList | |
[<Property>] | |
let ``URL bogus query parameters doesn't alter HTTP status`` () = | |
stubQueryParams | |
|> FSec.urlBogus "http://example.com" |
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
let getOrderIdsForName name = | |
use con = new SqlConnection "my-connection-string" | |
con.Open () | |
let sql = "SELECT OrderId FROM Orders WHERE Client = " + name | |
use cmd = new SqlCommand (sql, con) | |
cmd.CommandType <- CommandType.Text | |
let rdr = cmd.ExecuteReader () | |
seq { while rdr.Read () do | |
yield rdr.["OrderId"] |> 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
[Fact] | |
public async Task Publish_ValidParameters_Succeeds() | |
{ | |
// Arrange | |
var topicEndpoint = "<topic-endpoint>"; | |
var endpointKey = "<endpoint-key>"; | |
const string eventSubject = "integration-test"; | |
const string eventType = "integration-test-event"; | |
const string licensePlate = "1-TOM-337"; | |
var eventId = Guid.NewGuid().ToString(); |
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
/// <summary> | |
/// Gets the current health status of the API | |
/// </summary> | |
[HttpGet] | |
[Route("health")] | |
[SwaggerOperation("Get Health")] | |
[SwaggerResponse(HttpStatusCode.OK, "API is up & running")] | |
[SwaggerResponse(HttpStatusCode.InternalServerError, "API is not available")] | |
public IHttpActionResult Get() | |
{ |
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
{ | |
"$connections": { | |
"value": { | |
"FirstAPI": { | |
"connectionId": "/subscriptions/<subscriptionId>/resourceGroups/LogicApps_APIConn_ARM/providers/Microsoft.Web/connections/FirstAPI", | |
"connectionName": "FirstAPI", | |
"id": "/subscriptions/<subscriptionId>/providers/Microsoft.Web/locations/southcentralus/managedApis/ftp" | |
}, | |
"SecondAPI": { | |
"connectionId": "/subscriptions/<subscriptionId>/resourceGroups/LogicApps_APIConn_ARM/providers/Microsoft.Web/connections/SecondAPI", |
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
{ | |
"$connections": { | |
"value": { | |
"FirstAPI": { | |
"connectionId": "/subscriptions/<subscriptionId>/resourceGroups/LogicApps_APIConn/providers/Microsoft.Web/connections/FirstAPI", | |
"connectionName": "FirstAPI", | |
"id": "/subscriptions/<subscriptionId>/providers/Microsoft.Web/locations/northeurope/managedApis/ftp" | |
}, | |
"SecondAPI": { | |
"connectionId": "/subscriptions/<subscriptionId>/resourceGroups/LogicApps_APIConn/providers/Microsoft.Web/connections/SecondAPI", |