If you have any feedback from the session today, we'd love to hear it - Click here to provide feedback
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
# Create the Service Principal, generates a random password | |
$sp = New-AzADServicePrincipal -DisplayName ServicePrincipalName | |
# Export the random password that was generated on creation | |
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sp.Secret) | |
$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) | |
$UnsecureSecret |
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
az ad sp create-for-rbac --name ServicePrincipalDisplayName |
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
# Create the Service Principal, generates a random password, grants the Service Principal Contributor access to only a single resource group | |
$sp = New-AzADServicePrincipal -DisplayName ServicePrincipalName -Role Contributor -Scope /subscriptions/zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz/resourceGroups/myResourceGroup | |
# Export the random password that was generated on creation | |
$BSTR = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($sp.Secret) | |
$UnsecureSecret = [System.Runtime.InteropServices.Marshal]::PtrToStringAuto($BSTR) | |
$UnsecureSecret |
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
<# | |
.SYNOPSIS | |
Deploys a virtual machine in Azure using GitHub Actions | |
.DESCRIPTION | |
This script will deploy a virtual machine within Azure utilising GitHub Actions as the deployment technology. | |
.OUTPUTS | |
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
name: GitHub for IT Pro CI/CD Pipeline | |
env: | |
OUTPUT_PATH: ${{ github.workspace }} | |
on: [push] | |
jobs: | |
# Deploy VM in Azure |
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
#Create a Resource Group called "rg-smoketest" within the East US region | |
az group create --name rg-smoketest --location "East US" --tags 'Usage=Test' | |
#Create an Azure App Service Plan called SmokeTestASP within the rg-smoketest Resource Group and use the Free tier | |
az appservice plan create --name SmokeTestASP --resource-group rg-smoketest --sku FREE --tags 'Usage=Test' | |
#Create an Azure Web App called smoke-test app within the rg-smoketest resource group and attach it to the SmokeTestASP plan | |
az webapp create --name smoketest-web --resource-group rg-smoketest --plan SmokeTestASP |
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
/****** Set database settings ******/ | |
ALTER DATABASE [SpeakingLogs] SET ANSI_NULL_DEFAULT OFF | |
GO | |
ALTER DATABASE [SpeakingLogs] SET ANSI_NULLS OFF | |
GO | |
ALTER DATABASE [SpeakingLogs] SET ANSI_PADDING OFF | |
GO | |
ALTER DATABASE [SpeakingLogs] SET ANSI_WARNINGS OFF | |
GO | |
ALTER DATABASE [SpeakingLogs] SET ARITHABORT OFF |
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
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
CREATE TABLE [dbo].[SpeakingLogs]( | |
[LogId] [int] IDENTITY(1,1) NOT NULL, | |
[TalkDate] [date] NOT NULL, | |
[EventName] [varchar](255) NOT NULL, | |
[City] [varchar](255) NULL, | |
[Country] [varchar](255) NULL, |
OlderNewer