View import-csv-from-blob.sql
/*
Create the Database Master Key, if needed
*/
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'My-L0ng&Str0ng_P4ss0wrd!';
GO
/*
Create database scoped credentials to store the Shared Access Signature (SAS)
needed to access the Azure Blob Container. More info on Azure Blob SAS here:
View Security-Audit.ps1
Login-AzureRmAccount
Select-AzureRmSubscription -Subscription <your-subscription-id>
$servers = Get-AzureRmSqlServer
foreach($s in $servers) {
$databases = Get-AzureRmSqlDatabase -ServerName $s.ServerName -ResourceGroupName $s.ResourceGroupName
foreach ($d in $databases)
{
View stackoverflow-dapper-50091943.sql
use tempdb
go
drop table if exists dbo.City;
drop table if exists dbo.Country;
drop table if exists dbo.Continent;
create table dbo.Continent
(
continent_id int not null primary key,
View stackoverflow-dapper-50091943.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Dapper;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace stackoverflow_dapper_50091943
{
View Microsoft.PowerShell_profile.ps1
# Taken from https://joonro.github.io/blog/posts/powershell-customizations.html
# and https://hodgkins.io/ultimate-powershell-prompt-and-git-setup
Import-Module posh-git
Import-Module Get-ChildItemColor
Import-Module PSReadLine
$global:GitPromptSettings.BeforeText = '['
$global:GitPromptSettings.AfterText = '] '
View update-az-cli.ps1
Invoke-WebRequest https://aka.ms/installazurecliwindows -OutFile AzCliLatest.msi
.\AzCliLatest.msi /passive
View get-latest-object-version.sql
USE tempdb
GO
/*
Generate Sample Data
*/
DROP TABLE IF EXISTS dbo.[Sample]
GO
WITH cte AS
View OAuth2Middleware.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Authentication.OAuth;
using Newtonsoft.Json.Linq;
View access-json-file.sql
/*
Create the Database Master Key, if needed
*/
CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'My-L0ng&Str0ng_P4ss0wrd!';
GO
/*
Create database scoped credentials to store the Shared Access Signature (SAS)
needed to access the Azure Blob Container. More info on Azure Blob SAS here:
View azure-functions-save-form-data-to-sql-azure.sql
/*
Expected JSON:
{
"Subject": "Form's Subject",
"FirstName": "Davide",
"LastName": "Mauri",
"EmailAddress": "info@davidemauri.it",
"OtherField1": "OtherValue1",