There are many things to explore, but there is only so little time.
Pick and choose any of the assignments below, or explorer on your own.
As a nice repo to work with, you can use this one https://github.com/XpiritBV/GDBC2018-GDBCWebsite
param | |
( | |
[string] $BuildID="" | |
) | |
#global variables | |
$baseurl = $env:SYSTEM_TEAMFOUNDATIONCOLLECTIONURI | |
$baseurl += $env:SYSTEM_TEAMPROJECT + "/_apis" | |
Write-Debug "baseurl=$baseurl" |
function Invoke-CheckSameCommitInBuild | |
{ | |
$CurrentBuild = Get-BuildById -BuildId $currentBuildID | |
$builds = Get-BuildsByDefinition -BuildDefinitionID $CurrentBuild.definition[0].id | |
$LatestBuild = $builds.value | Where-Object {$_.result -eq "succeeded"} |Sort-Object {$_.finishtime} -Descending | select -First 1 | |
if ($LatestBuild -eq $null) | |
{ |
$password = ConvertTo-SecureString 'PAT' -AsPlainText -Force | |
$vstsCredential = New-Object System.Management.Automation.PSCredential 'vstsuseraccount-email', $password | |
Find-Module -Name roadtoalmUtils -Repository VSTSGallery -Credential $vstsCredential | |
install-Module -Name roadtoalmUtils -Repository VSTSGallery -Credential $vstsCredential | |
Get-Module -ListAvailable -Name roadtoalmUtils |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions | |
cinst curl | |
cinst winrar | |
#Using the great extension in VS Code https://marketplace.visualstudio.com/items?itemName=humao.rest-client | |
#use the gist GetBasicAuthToken.ps1 to get a valid token from a PAT | |
@collectionurl=https://account.visualstudio.com | |
@token=Base64EncryptedPAT e.g. Basic ONOTAVALIDTOKEN=" | |
### | |
# Get all Available Branch Policies in the project | |
# --> value.id contains branch policy type id | |
GET {{collectionurl}}/_apis/projects/?api-version=1.0 |
There are many things to explore, but there is only so little time.
Pick and choose any of the assignments below, or explorer on your own.
As a nice repo to work with, you can use this one https://github.com/XpiritBV/GDBC2018-GDBCWebsite
pool: | |
vmImage: 'ubuntu-latest' | |
trigger: | |
- master | |
- development | |
steps: | |
- task: PowerShell@2 | |
displayName: Determine source branch |
# Login with you Azure account that has rights to create SPN's | |
$sqladminSPN = "blog-sql-admin" | |
az login | |
az ad app create --display-name $sqladminSPN | |
#Setting up SQL | |
$resourcegroup = "rg-blog-sql" | |
$sqlservername = "blog-sqlsrv-rvo" | |
$location = "westeurope" | |
$databasename="tododb" |