Skip to content

Instantly share code, notes, and snippets.

View RichieBzzzt's full-sized avatar
🦆
Sirfetch'd

Richie Lee RichieBzzzt

🦆
Sirfetch'd
View GitHub Profile
trigger:
none
pr:
autoCancel: true
branches:
include:
- none
pool:
if ($null -eq (Get-AzContext)) {
Write-Host "No Azure Context... logging in."
Login-AzAccount -UseDeviceAuthentication
}
$groups = @("bob","tim"
)
$outputPath = ""
[CmdletBinding()]
param (
[string]$packageSourceUrl = 'https://pkgs.dev.azure.com/[orgname]/[randomguid]/_packaging/[feedname]/nuget/v3/index.json',
[string]$AzDOArtifactFeedName = '[feedname]',
[string]$AzDOPat,
[string]$ModuleFolderPath = (Join-Path -Path $env:SYSTEM_ARTIFACTSDIRECTORY -ChildPath "[.artifact.alias]\[folder.what.contains.module]")
)
# Variables
$feedUsername = 'NotChecked'
#Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
#Requires -Module @{ModuleName="AzureRm.Profile";ModuleVersion="3.0"}
Param(
[string] [Parameter(Mandatory = $true)] $ArtifactStagingDirectory,
[string] [Parameter(Mandatory = $true)][alias("ResourceGroupLocation")] $Location,
[string] $ResourceGroupName = (Split-Path $ArtifactStagingDirectory -Leaf),
[switch] $UploadArtifacts,
param(
[string]
$numberOfConcurrentActivities
)
$registryPath = "HKLM:\SOFTWARE\Microsoft\DataTransfer\DataManagementGateway\Gateway"
$Name = "WorkerProcessCount"
if (($numberOfConcurrentActivities -match "^[\d\.]+$") -eq $false)
{
Write-Error "Number of concurrent activites needss to be a number."
Throw
function Set-LocalNotebook ($DatabricksFile, $Language, $LocalOutputPath, $Format = "SOURCE") {
$DatabricksFileForUrl = Format-DataBricksFileName -DataBricksFile $DatabricksFile
$uri = "$global:DatabricksURI/api/2.0/workspace/export?path=" + $DatabricksFileForUrl + "&format=$Format&direct_download=false"
switch ($Format) {
"SOURCE" {
$FileExtentions = @{"PYTHON" = ".py"; "SCALA" = ".scala"; "SQL" = ".sql"; "R" = ".r" }
$FileExt = $FileExtentions[$Language]
}
"HTML" {
$aadConnectionString = "Server=tcp:$($AzureSqlFQDN),1433;Initial Catalog=myLittleDatabbase;Persist Security Info=False;User ID=$($aadAdminUser);Password=$($aadAdminPassword);MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Authentication=""Active Directory Password"";"
@RichieBzzzt
RichieBzzzt / keyvault_arm_with_access_policy.json
Created July 24, 2019 08:17
part of arm template for deploying keyvault
{
"type": "Microsoft.KeyVault/vaults",
"name": "[parameters('keyVaultName')]",
"apiVersion": "2018-02-14",
"location": "[resourceGroup().location]",
"tags": {},
"scale": null,
"properties": {
"sku": {
"family": "A",
function Invoke-MsBuildSSDT {
<#
.SYNOPSIS
Build a datbase project/solution using Microsoft.Data.Tools.MSBuild
.DESCRIPTION
Using MSBUild, the database project/solution is comiled using Microsoft.Data.Tools.MSBuild. This can be downloaded by using Install-MicrosoftDataToolsMSBuild
.PARAMETER DatabaseSolutionFilePath
Mandatory - Filepath to the sln/sqlproj file.
$subscriptionId = ''
$resourceGroupName = ''
$factoryName = ''
$integrationRuntimeNames = @('', '')
$ErrorActionPreference = "Stop"
try{
Get-AzureRmSubscription -SubscriptionId $subscriptionId -ErrorVariable nosession
}
catch {}
if ($nosession) {