Skip to content

Instantly share code, notes, and snippets.

View MarcusFelling's full-sized avatar

Marcus Felling MarcusFelling

View GitHub Profile
@MarcusFelling
MarcusFelling / hdi-nsg-with-vnet.bicep
Last active May 17, 2021 14:17
hdi-nsg-with-vnet.bicep
param location string = resourceGroup().location
param clusteruser string = 'clusteradmin'
param sshuser string = 'sshadmin'
@secure()
param clusterpassword string = 'ChangeMe12345'
@secure()
param sshpassword string = '12345ChangeMe'
resource storage 'Microsoft.Storage/storageAccounts@2021-02-01' = {
name: 'storhdi${uniqueString(resourceGroup().id)}'
// The following will create an Azure Function app on
// a consumption plan, along with a storage account
// and application insights.
param location string = resourceGroup().location
param appNamePrefix string = uniqueString(resourceGroup().id)
param workspaceResourceId string
var functionAppName = '${appNamePrefix}-functionapp'
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"appName": {
"type": "string"
},
"sku": {
"type": "string",
"defaultValue": "F1",
name: "Terraform Plan"
on: pull_request
jobs:
terraform:
name: "Run Terraform Plan"
runs-on: ubuntu-latest
# Add env variables for service principal
env:
ARM_CLIENT_ID: ${{ secrets.TF_VAR_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.TF_VAR_ARM_CLIENT_SECRET }}
jobs:
terraform:
name: "Run Terraform Plan"
runs-on: ubuntu-latest
# Add env variables for service principal
env:
ARM_CLIENT_ID: ${{ secrets.TF_VAR_ARM_CLIENT_ID }}
ARM_CLIENT_SECRET: ${{ secrets.TF_VAR_ARM_CLIENT_SECRET }}
ARM_SUBSCRIPTION_ID: ${{ secrets.TF_VAR_ARM_SUBSCRIPTION_ID }}
ARM_TENANT_ID: ${{ secrets.TF_VAR_ARM_TENANT_ID }}
@MarcusFelling
MarcusFelling / azure-pipelines.yml
Created April 22, 2020 18:06
YAML pipeline for Space Game webb app
name: $(Major).$(Minor).$(Patch)
variables:
buildConfiguration: 'Release'
dotnetSdkVersion: '2.1.505'
serviceConnection: 'tailspin-space-game-rg'
appName: 'tailspin-space-game-web'
appID: '26178'
SITE_URL: 'https://$(appName)-$(System.StageName)-$(appID).azurewebsites.net'
wwwrootDir: 'Tailspin.SpaceGame.Web/wwwroot'
Major: '1'
steps:
- ${{ if eq(resources.repositories['self'].ref, resources.repositories['self'].defaultBranch) }}:
- task: SonarQubeAnalyze@4
displayName: 'Run Code Analysis (injected from decorator)'
steps:
- ${{ if eq(resources.repositories['self'].ref, resources.repositories['self'].defaultBranch) }}:
- task: SonarQubePrepare@4
displayName: 'Prepare Code Analysis (injected from decorator)'
inputs:
SonarQube: 'My SonarQube Server'
scannerMode: 'MSBuild'
projectKey: '$(Build.DefinitionName)'
projectName: '$(Build.DefinitionName)'
projectVersion: '$(Build.BuildId)'
{
"manifestVersion": 1,
"id": "pipelinedecorator",
"name": "SonarQube Decorator Example",
"version": "1.0.2",
"publisher": "MarcusFelling-Blog",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
using namespace System.Net
# Input bindings are passed in via param block.
param($Request, $TriggerMetadata)
# Write to the Azure Functions log stream.
"PowerShell HTTP trigger function processed a request."
# Get Personal Access Token (PAT) from query parameter of the request.
$PAT = $Request.Query.PAT