This file contains hidden or 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
@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.') |
This file contains hidden or 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
# This runbook deletes all resource groups under a management group except for the ones with a specific tag. | |
<# | |
.SYNOPSIS | |
Deletes all resource groups under a management group except for the ones with a specific tag. | |
.DESCRIPTION | |
This script deletes all resource groups under a specified management group except for the ones with a specific tag. It can also delete policy assignments and subscription role assignments if specified. | |
.PARAMETER ManagementGroupId | |
The ID of the management group to delete resource groups under. WARNING: This script will delete all resource groups under the specified management group except for the ones with the specified tag. Make sure you have specified the correct management group ID, or you may accidentally delete resources that you did not intend to delete. |
This file contains hidden or 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
function New-AzCountryIPGroup { | |
<# | |
.SYNOPSIS | |
Creates an Azure IP group, with the IP address ranges for various countrues. | |
The code does the following: | |
1. It downloads the IP address ranges for the country specified. | |
2. It checks if the IP Group already exists, if it does, it adds the IP addresses to the existing IP Group. | |
3. If the total number of IP addresses is less than 5000, it will add the IP addresses to the existing IP Group. | |
4. If the total number of IP addresses is over 5000, it will create a new IP Group, with the same name as the existing IP Group, and it will add the IP addresses to the new IP Group. | |
5. If the new IP Group is over 5000, it will create a new IP Group, with the same name as the existing IP Group, and it will add the IP addresses to the new IP Group. |
This file contains hidden or 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 hidden or 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 = '[email protected]' | |
password = 'password' |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 = @{ |