Skip to content

Instantly share code, notes, and snippets.

View sjwaight's full-sized avatar
😎
Happy Days

Simon Waight sjwaight

😎
Happy Days
View GitHub Profile
@sjwaight
sjwaight / fullbuilddeployk8swindows.yaml
Created April 20, 2021 10:38
Complete GitHub Action showing how to build and deploy a Windows Container app to Kubernetes using Helm
name: Build Windows Container Image
on:
push:
branches: [ deploy-to-k8s ]
pull_request:
branches: [ deploy-to-k8s ]
workflow_dispatch:
env:
@sjwaight
sjwaight / values.yaml
Last active April 20, 2021 10:33
Simple Helm Chart values file for MVC Music Store ASP.NET Web Application
# Default values for mvcmusicstoreweb.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: your_repo.azurecr.io/mvcmusicstoreweb
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
@sjwaight
sjwaight / Chart.yaml
Created April 19, 2021 05:04
Simple Helm Chart definition for the MVC Music Store ASP.NET Web Application
apiVersion: v2
name: mvcmusicstoreweb
description: MVC Music Store web application
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
@sjwaight
sjwaight / buildandpushmusicstore.yaml
Created April 18, 2021 08:46
Sample GitHub Action that builds the MVC Music Store sample and pushes the container to Azure Container Registry
name: Build Windows Container Image
on:
push:
branches: [ post-containerisation ]
pull_request:
branches: [ post-containerisation ]
workflow_dispatch:
env:
@sjwaight
sjwaight / WinContainerfull.dockerfile
Created March 29, 2021 10:31
Full dockerfile that shows how to build and package an .NET Framework application for use with Windows Containers
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY MvcMusicStore-Completed/*.sln .
COPY MvcMusicStore-Completed/MvcMusicStore/*.csproj ./MvcMusicStore/
COPY MvcMusicStore-Completed/MvcMusicStore/*.config ./MvcMusicStore/
RUN nuget restore
# copy everything else and build app
@sjwaight
sjwaight / VS.dockerfile
Last active March 29, 2021 05:03
Default Visual Studio 2019 Container Tools Dockerfile
#Depending on the operating system of the host machines(s) that will build or run the containers, the image specified in the FROM statement may need to be changed.
#For more information, please see https://aka.ms/containercompat
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019
ARG source
WORKDIR /inetpub/wwwroot
COPY ${source:-obj/Docker/publish} .
@sjwaight
sjwaight / musicstoreentities-secret.yml
Created March 29, 2021 03:59
Single Kubernetes secret we can deploy using kubectl
apiVersion: v1
kind: Secret
metadata:
name: dbconnection
type: Opaque
data:
connstring: U2Vy_NOT_A_VALID_BASE_64_sdoinsdcoin=
@sjwaight
sjwaight / session-sql-web-config.xml
Last active March 20, 2021 00:03
web.config sample showing SQL Server session state configuration
<sessionState mode="Custom" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider"
type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
connectionStringName="MusicStoreEntities" />
</providers>
</sessionState>
@sjwaight
sjwaight / sqlconnection-env.xml
Created March 19, 2021 04:04
SQL Connection web.config section showing use of ConfigBuilder Environment source
<connectionStrings configBuilders="Environment">
<add name="MusicStoreEntities"
connectionString="ignored"
providerName="System.Data.SqlClient" />
</connectionStrings>
@sjwaight
sjwaight / sqlconnection.xml
Last active March 19, 2021 03:44
web.config snippet sample showing a SQL Connection String
<connectionStrings>
<add name="MusicStoreEntities"
connectionString="Server=myServerAddress;Database=myDataBase;User Id=myUsername;Password=myPassword;"
providerName="System.Data.SqlClient" />
</connectionStrings>