This file contains 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
string secretUrl = "https://myvaulttest.vault.azure.net/secrets/MyPassword/00000000000000000000000000000000"; | |
//Retrieve a secret by its url | |
var getKeyByUrlTask1 = Task.Run(async () => await GetSecretByUrl(token, secretUrl)); | |
Task.WaitAll(getKeyByUrlTask1); | |
if (getKeyByUrlTask1.Result == null) | |
throw new InvalidPluginExecutionException("Error retrieving secret value from key vault"); | |
//Deserialize the vault response to get the secret | |
GetSecretResponse getSecretResponse1 = DeserializeResponse<GetSecretResponse>(getKeyByUrlTask1.Result); | |
//returnedValue is the Azure Key Vault Secret |
This file contains 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
string vaultName = "https://myvaulttest.vault.azure.net"; | |
string secretName = "MyPassword"; | |
//Retrieve the latest version of a secret by name | |
var getKeyByNameTask = Task.Run(async () => await GetSecretByName(token, vaultName, secretName)); | |
Task.WaitAll(getKeyByNameTask); | |
if (getKeyByNameTask.Result == null) | |
throw new InvalidPluginExecutionException("Error retrieving secret versions from key vault"); | |
var retrievedSecretUrl = getKeyByNameTask.Result; | |
// Retrieve a secret by its url |
This file contains 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
public void Execute(IServiceProvider serviceProvider) | |
{ | |
ITracingService tracer = (ITracingService)serviceProvider.GetService(typeof(ITracingService)); | |
MethodTimeLogger.Tracer = tracer; | |
// What manually setting up method timing might look like | |
ManualTimer(tracer); | |
// What using IL weaving to inject logging looks like |
This file contains 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
using System; | |
using System.IO; | |
using System.Net; | |
using System.Security.Cryptography; | |
using System.Text; | |
using System.Xml; | |
namespace CRMSoapAuthCSharp | |
{ | |
class CrmAuth |
This file contains 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
{ | |
"data": { | |
"baseData": { | |
"application_Version": "9.0.0.2090", | |
"dependencies": null, | |
"exceptions": null, | |
"measurements": null, | |
"message": "Hello world", | |
"metrics": null, | |
"properties": { |
This file contains 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
{ | |
"data": { | |
"baseData": { | |
"application_Version": "9.0.0.2090", | |
"dependencies": null, | |
"exceptions": null, | |
"measurements": { | |
"SomethingTrackableNumber": 100 | |
}, | |
"message": null, |
This file contains 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
{ | |
"data": { | |
"baseData": { | |
"application_Version": "9.0.0.2090", | |
"dependencies": null, | |
"exceptions": null, | |
"measurements": null, | |
"message": null, | |
"metrics": [ | |
{ |
This file contains 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
{ | |
"data": { | |
"baseData": { | |
"application_Version": "9.0.0.2090", | |
"properties": { | |
"orgName": "test.crm.dynamics.com", | |
"source": "Microsoft Flow" | |
}, | |
"severityLevel": null, | |
"ver": 2, |
This file contains 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
using System.Net; | |
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log) | |
{ | |
log.Info("Starting Function"); | |
string start = req.GetQueryNameValuePairs() | |
.FirstOrDefault(q => string.Compare(q.Key, "start", true) == 0) | |
.Value; |
This file contains 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
$startBuild = Get-Date -Date "$Env:System_PipelineStartTime" | |
Write-Host "Start time: $startBuild" | |
$endBuild = Get-Date | |
Write-Host "End time: $endBuild" | |
$ts = New-TimeSpan -Start $startBuild -End $endBuild | |
$tm = [math]::Round($ts.TotalMinutes, 2) | |
Write-Host "Build time (min): $tm" | |
# $(AppInsightsKey) should be your Application Insights Instrumentation Key | |
if (-Not ('$(AppInsightsKey)' -match("^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$"))) |