This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - task: Bash@3 | |
| inputs: | |
| targetType: 'inline' | |
| script: | | |
| EPOCH=$(($(date +%s%N)/1000000)) | |
| curl -X POST $(grafana_api_endpoint)/annotations -H 'Content-Type: application/json' -H 'Authorization:Bearer $(grafana_annotations_key)' -d '{"created": '"$EPOCH"', "updated": '"$EPOCH"', "time": '"$EPOCH"', "timeEnd": '"$EPOCH"',"text": "Deployment", "tags": ["kind:deployment","project:'"$(Build.Repository.Name)"'"]}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| This snippet assumes a valid refresh token. To see how to get one of those, check out: | |
| https://www.thelazyadministrator.com/2019/07/22/connect-and-navigate-the-microsoft-graph-api-with-powershell/#3_Authentication_and_Authorization_Different_Methods_to_Connect | |
| #> | |
| $clientId = "1950a258-227b-4e31-a9cf-717495945fc2" # This is the standard client ID for Windows Azure PowerShell | |
| $redirectUrl = [System.Uri]"urn:ietf:wg:oauth:2.0:oob" # This is the standard Redirect URI for Windows Azure PowerShell | |
| $tenant = "fabrikam.onmicrosoft.com" # TODO - your tenant name goes here | |
| $resource = "https://graph.microsoft.com/"; | |
| $serviceRootURL = "https://graph.microsoft.com//$tenant" |