Skip to content

Instantly share code, notes, and snippets.

View lukemurraynz's full-sized avatar
☁️
Breaking things!

Luke Murray lukemurraynz

☁️
Breaking things!
View GitHub Profile
#Requires -PSEdition Desktop
function Get-AzureValidateResourceMoveResult
{
<#
.SYNOPSIS
Function to call Azure Validation API
.EXAMPLE
PS C:\>$validateSplat = @{
>> SourceSubscriptionID = '11111111-1111-1111-1111-111111111111'
# The name of the pipeline, including the date and a revision number
name: copa_$(Date:yyyyMMdd)_$(Rev:r)
# This pipeline is not triggered automatically by any event
trigger: none
# This pipeline is not triggered automatically by any pull request
pr: none
# Parameters for the pipeline
@lukemurraynz
lukemurraynz / storageaccount.bicep
Created November 22, 2023 05:30
Azure Image Builder
// Define the location parameter for all resources
@description('Location for all resources.')
param location string = resourceGroup().location
// Define the parameter for the Storage account name
@description('The name of the Storage account.')
param stgaccountname string
// Define the parameter for the public access setting of the Storage account
@description('Sets the public access of the storage account.')
@lukemurraynz
lukemurraynz / azure-pipelines.yml
Created November 22, 2023 05:15
Azure Image Builder
# Define the pipeline name and trigger
name: Azure Image Builder - Build and Publish Image Template
trigger:
- main
# Define pipeline variables
variables:
serviceconnection: azserviceconnections
overwrite: false
@lukemurraynz
lukemurraynz / customizations.bicep
Created November 22, 2023 05:14
Azure Image Builder
// Define the parameter for the Storage account name
@description('The name of the Storage account.')
param stgaccountname string
// Get the environment-specific metadata
var environmentMetadata = environment()
// Define the customizations for the image
var customizations = [
// Create a apps directory on the OS drive
@lukemurraynz
lukemurraynz / main.bicep
Created November 22, 2023 05:13
Azure Image Builder
// Define parameters for the Bicep template
param location string = resourceGroup().location
param imagetemplatename string
param azComputeGalleryName string = 'myGallery'
@description('The name of the Storage account.')
param stgaccountname string
param azUserAssignedManagedIdentity string = 'useri'
// Define the details for the VM offer
var vmOfferDetails = {
#Hidden Tags demo
# Check with AzTags
Get-AzTag
# Add a tag to a resource demo
$replacedTags = @{"hidden-title" = "Web Server"; "hidden-ShutdownAutomation" = "Yes"}
$resouceGroup = 'hiddentags-demo'
@lukemurraynz
lukemurraynz / azure-pipelines.yml
Created September 13, 2023 01:58
Test connectivity Azure DevOps pipeline
trigger:
- main
pool:
name: containerapp-adoagent
jobs:
- job: Setup
displayName: Get Environment - Linux
@lukemurraynz
lukemurraynz / main.bicep
Last active September 13, 2023 03:02
Container Apps - ADO Agent
// Define parameters
// https://github.com/lukemurraynz/containerapps-selfhosted-agent
param location string = resourceGroup().location
@description('The location where the resources will be deployed. Based on the Resource Group location.')
param poolName string = 'containerapp-adoagent'
@description('The name of the Azure DevOps agent pool.')
@maxLength(50)
param containerregistryName string = 'adoregistry'
@description('The name of the Azure Container Registry.')
param adourl string = 'https://dev.azure.com/contoso'
@lukemurraynz
lukemurraynz / main.bicep
Last active August 28, 2023 01:34
VNET and NSG creation Azure Bicep
@description('Name of the virtual network.')
param vnetName string = 'myVnet'
@description('Name of the first subnet.')
param subnet1Name string = 'subnet1'
@description('Name of the second subnet.')
param subnet2Name string = 'subnet2'
@description('Name of the first network security group.')