Skip to content

Instantly share code, notes, and snippets.

View marckean's full-sized avatar

Marc Kean marckean

View GitHub Profile
$ServicePrincipalConnection = Get-AutomationConnection -Name 'AzureRunAsConnection'
$null = Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $ServicePrincipalConnection.TenantId `
-ApplicationId $ServicePrincipalConnection.ApplicationId `
-CertificateThumbprint $ServicePrincipalConnection.CertificateThumbprint
##################################################################
##################################################################
$ServicePrincipalConnection = Get-AutomationConnection -Name 'AzureRunAsConnection'
Add-AzureRmAccount `
-ServicePrincipal `
-TenantId $ServicePrincipalConnection.TenantId `
-ApplicationId $ServicePrincipalConnection.ApplicationId `
-CertificateThumbprint $ServicePrincipalConnection.CertificateThumbprint
##################################################################
##################################################################
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string",
"metadata": {
"description": "Deployment location"
},
"defaultValue": "australiaeast"
### RUN AS ADMINISTRATOR
# This script here string, will be copied to the local computer to be run locally
# Change the variables in this script, they are at the top in this here string
$script = @'
# Testing, $args is an array object ($args | Out-File "C:\Scripts\PerformanceAlert.txt" –Append)
#########################################
# Replace with your Workspace ID
$LogAnalyticsCustomerID = "Workspace ID"
# Replace with your Workspace ID
$CustomerID = $REQ_PARAMS_LogAnalyticsCustomerID
# Replace with your Log Analytics workspace Primary Key
$SharedKey = $REQ_PARAMS_LogAnalyticsPrimaryKey
#Specify the name of the record type that we'll be creating.
$LogType = $REQ_PARAMS_LogType # To be used to search for as a custom log e.g. Type=iTunesPopCharts2_CL
# Specify a time in the format YYYY-MM-DDThh:mm:ssZ to specify a created time for the records
$TimeStampField = ''
# Telstra DEV APIs - https://dev.telstra.com
$Telstra_app_key = $REQ_PARAMS_Telstra_app_key
### RUN AS ADMINISTRATOR
# This script here string, will be copied to the local computer to be run locally
# Change the variables in this script, they are at the top in this here string
$script = @'
# Replace with your Workspace ID
$LogAnalyticsCustomerID = "Workspace ID"
# Replace with your Log Analytics workspace Primary Key
$LogAnalyticsPrimaryKey = "workspace Primary Key"
# Replace with your Workspace ID
$CustomerID = $REQ_PARAMS_LogAnalyticsCustomerID
# Replace with your Log Analytics workspace Primary Key
$SharedKey = $REQ_PARAMS_LogAnalyticsPrimaryKey
#Specify the name of the record type that we'll be creating.
$LogType = $REQ_PARAMS_LogType # To be used to search for as a custom log e.g. Type=iTunesPopCharts2_CL
# Specify a time in the format YYYY-MM-DDThh:mm:ssZ to specify a created time for the records
$TimeStampField = ''
# Telstra DEV APIs - https://dev.telstra.com
$Telstra_app_key = $REQ_PARAMS_Telstra_app_key
#region variables
# Replace with your Workspace ID
$CustomerID = 'Your_Workspace_Key'
# Replace with your Primary Key
$SharedKey = 'Your_OMS_Key'
#Specify the name of the record type that we'll be creating.
$LogType = 'Your_Log_Name' # To be used to search for as a custom log e.g. Type=iTunesPopCharts2_CL
# Specify a time in the format YYYY-MM-DDThh:mm:ssZ to specify a created time for the records
$TimeStampField = ''
#endregion
configuration Main
{
param
(
[string]$JukeboxID = "localhost",
[string]$nodeName = $env:COMPUTERNAME,
[string]$VNCKey
)
#Import-DscResource -Name 'xRemoteFile' -ModuleName '.\xPSDesiredStateConfiguration'
# Login to Azure manually
Clear-AzureRmContext -Scope CurrentUser -Force
Login-AzureRmAccount -TenantId '<Your Azure Tenant ID>' # Microsoft
### Choose Subscription
$subscription = Get-AzureRmSubscription | Out-GridView -Title "Select the Azure subscription that you want to use ..." -PassThru
Select-AzureRmSubscription -SubscriptionId $subscription.id
# Fill in these variables