Skip to content

Instantly share code, notes, and snippets.

View bjornpeters's full-sized avatar

Bjorn Peters bjornpeters

View GitHub Profile
- HttpTrigger1
- function.json
- run.ps1
- sample.dat
- .funcignore
- .gitignore
- host.json
- local.settings.json
- profile.ps1
- requirements.psd1
az resource list --resource-group bpdev-azure-functions
az deployment group create --resource-group bpdev-azure-functions --template-file main.bicep --name 'First Deployment'
az bicep build --file .\main.bicep
az group create --location 'westeurope' --resource-group bpdev-azure-functions
@bjornpeters
bjornpeters / Install-WAC.ps1
Created September 9, 2021 19:48
Download and install Windows Admin Center
# Variables
$wacDownloadUrl = 'http://aka.ms/WACDownload'
$downloadPath = "$env:USERPROFILE\Downloads\WAC.msi"
$port = 443
# Download the Windows Admin Center MSI from Microsoft
Invoke-WebRequest $wacDownloadUrl -OutFile $downloadPath
# Install Windows Admin Center using msiexec
Start-Process -FilePath 'msiexec.exe' -ArgumentList "/i $downloadPath /qn /L*v log.txt SME_PORT=$port SSL_CERTIFICATE_OPTION=generate" -Wait
# Install the required module just to be sure
Install-Module Az.ConnectedMachine
# Create a resource group in the selected subscription
New-AzResourceGroup -Name 'azure-arc' -Location 'West Europe'
# Download the agent and deploy the machine in the resource group
Connect-AzConnectedMachine -ResourceGroupName 'azure-arc' -Name 'hostname of your machine' -Location 'West Europe'
# Connect with the Azure service
Connect-AzAccount
# Get available subscriptions within the tenant
Get-AzSubscription
# Set the context to the selected subscription
Set-AzContext -SubscriptionId 'subscription ID you want to use'
# Register the required resource providers for Azure Arc
# Variables for Azure Functions
$localFunctionDirectory = "~/github"
$functionAppName = 'microsoft-graph-func'
# Variables for the trigger inside the Azure Function app
$functionTriggerName = 'getgraph'
$functionTemplate = 'HTTP trigger'
$functionAuthLevel = 'function'
# Set location to the new Function App directory