This file contains 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 static class AlwaysOn | |
{ | |
/// <summary> | |
/// Prevent 404 on the application root URL. Azure Web Apps with Always On enabled invoke the root of the application every 5 minutes | |
/// to keep your web app awake. If you run an API-only app you likely have nothing listening to /, which results in a 404 response | |
/// that shows up in monitoring. This endpoint returns 200 with content Ok only for the always on check. | |
/// </summary> | |
/// <param name="builder">The application builder.</param> | |
/// <returns>The application builder.</returns> | |
public static IApplicationBuilder UseAlwaysOn(this IApplicationBuilder builder) |
This file contains 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 Microsoft.OpenApi.Models; | |
using Swashbuckle.AspNetCore.SwaggerGen; | |
using Swashbuckle.AspNetCore.SwaggerUI; | |
public static void AddSwaggerHMACSupport(this IServiceCollection services) | |
{ | |
const string HmacSecretHeaderName = "X-HMAC-Secret"; | |
services.Configure<SwaggerUIOptions>(opts => | |
{ |
This file contains 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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": {}, | |
"variables": { | |
"publicSitePolicy": "my-wafpolicy-for-public-sites", | |
"htmlOwaspRuleOverrides": [ | |
{ | |
"ruleGroupName": "REQUEST-932-APPLICATION-ATTACK-RCE", | |
"rules": [ |
This file contains 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 Microsoft.Azure.WebJobs; | |
using Microsoft.Azure.WebJobs.Extensions.DurableTask; | |
using Microsoft.Extensions.Logging; | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace DurableFunctionsPatterns | |
{ | |
public class EternalFunctionWithWatchdogTimer |
This file contains 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.Configuration; | |
using System.Web; | |
using Telerik.Cms.Web; | |
namespace Alanta.Sitefinity | |
{ | |
public class CmsHttpModule : IHttpModule | |
{ | |
private Telerik.Cms.Web.CmsHttpModule _cmsHttpModule; |
This file contains 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 When_the_function_host_is_configured | |
{ | |
[Theory] | |
[MemberData(nameof(Functions))] | |
public void It_should_be_able_to_instantiate_all_functions(Type functionType) | |
{ | |
// Arrange | |
var startup = new MyFunctions.Startup(); | |
var host = new HostBuilder() | |
.ConfigureWebJobs(cfg => |
This file contains 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 FluentAssertions; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.Testing; | |
using Microsoft.Extensions.Configuration; | |
using Microsoft.Extensions.DependencyInjection; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using Xunit; |
This file contains 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 ([Parameter(Mandatory)]$keyvaultname) | |
$userid = az ad signed-in-user show --query objectId | |
if($LASTEXITCODE){ | |
Write-Information "Please login using 'az login' and make sure you select the correct subscription with 'az account'" | |
} | |
az keyvault set-policy -n $keyvaultname --secret-permissions backup delete get list purge recover restore set --object-id $userid |
This file contains 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
UPDATE [dbo].[CMS_User] | |
SET | |
UserName=CONCAT('U',UserID), | |
FirstName= CONCAT('U',UserID), | |
MiddleName=NULL, | |
LastName='Anoniem', | |
FullName= CONCAT('U',UserID,' Anoniem'), | |
Email=CONCAT('U',UserID,'@localhost'), | |
UserPassword=CONVERT(NVARCHAR(32),HashBytes('SHA1', 'Super secret password'),2), |
This file contains 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.Linq; | |
using BenchmarkDotNet.Attributes; | |
using BenchmarkDotNet.Running; | |
using System.Runtime.InteropServices; | |
namespace ClassLibrary2 | |
{ | |
public class Rounding | |
{ |
NewerOlder