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: Azure Static Web Apps CI/CD | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: [opened, synchronize, reopened, closed] | |
branches: | |
- main |
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
#Libraries | |
import pyodbc | |
#Connection to SQL database | |
server = 'tcp:SQLSERVER.database.windows.net' | |
database = 'DBNAME' | |
username = 'user@contoso.com' | |
password = 'password' |
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
//Related to a Blog Article: https://luke.geek.nz for setting up Azure Naming Tool. | |
///Parameter Setting | |
param location string = resourceGroup().location | |
//Adjust Parameter values to match your naming conventions | |
param serverfarms_AzNamingTool_ASP_Prod_name string = 'AzNamingTool-ASP-Prod' | |
param storageAccounts_aznamingstgacc_name string = 'aznaming' | |
// The following Parameters are used add Tags to your deployed resources. Adjust for your own needs. |
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
#requires -Version 3.0 -Modules Az.Accounts, Az.Resources | |
<# | |
.SYNOPSIS | |
PowerShell Azure Automation Runbook for Starting/Stopping Virtual Machines. | |
.AUTHOR | |
Luke Murray (https://github.com/lukemurraynz/) | |
.VERSION | |
1.0 - 28/04/22 - script versioned to '1.0'. | |
.DESCRIPTION | |
1. The script first checks if today is a holiday by making a call to the Abstract API. |
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
#requires -Version 3.0 -Modules Az.Accounts, Az.AlertsManagement | |
<# | |
.SYNOPSIS | |
PowerShell Azure Automation Runbook for Stopping Virtual Machines, that have been Shutdown within the Windows Operating System (Stopped and not Deallocated). | |
.AUTHOR | |
Luke Murray (https://github.com/lukemurraynz/) | |
#> | |
[OutputType('PSAzureOperationResponse')] | |
param ( |
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
targetScope = 'resourceGroup' | |
///Parameter and Variable Setting | |
@minLength(3) | |
@maxLength(6) | |
param sitecode string = '' | |
param environment string = '' | |
param contactEmail string = '' |
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
#requires -Version 1.0 | |
# Variables | |
#Enter your subscription name | |
$subscriptionName = 'luke.geek.nz' | |
#Enter the name of yuour | |
$policyDisplayName = 'Deploy - Log Analytics' #Cant Exceed 24 characters | |
$location = 'australiaeast' | |
$resourceGroup = 'aoegeek-rg' | |
$UsrIdentityName = 'AOE_ManagedIdentityUsr' | |
$param = @{ |
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
# Variable 'location' was defined in the Variables tab | |
# Variable 'PrimaryDNSZone' was defined in the Variables tab | |
# Variable 'ResourceGroupName' was defined in the Variables tab | |
# Variable 'SPN' is defined in the Variables tab | |
trigger: | |
branches: | |
include: | |
- refs/heads/main | |
jobs: | |
- job: Job_1 |
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
///Variables - Edit, these variables can be set in the script or implemented as part of Azure DevOps variables. | |
//Set the Domain Name Zone: | |
param PrimaryDNSZone string = '' | |
//Deploys to the location of your resource group, that is specified during the deployment. | |
var location = 'Global' | |
//Variable array for your A records. Add, remove and amend as needed, any new record needs to be included in {}. | |
var arecords = [ | |
{ | |
name: '@' | |
ipv4Address: '8.8.8.8' |
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 storageaccprefix string = '' | |
var location = resourceGroup().location | |
resource storageacc 'Microsoft.Storage/storageAccounts@2021-06-01' = { | |
name: '${storageaccprefix}${uniqueString(resourceGroup().id)}' | |
location: location | |
sku: { | |
name: 'Standard_ZRS' | |
} | |
kind: 'StorageV2' |