Skip to content

Commit 595534c

Browse files
authored
Actually add an Azure event listener (#167)
Without a configured listener, we get no info on console. With it, we get a LOT of useful diagnostics, including burning questions like "what did DefaultAzureCredential actually do?"
1 parent 192e3ab commit 595534c

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Microsoft.SourceIndexer.Tasks/DownloadStage1Index.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using System.Linq;
44
using System.Text;
55
using Azure;
6+
using Azure.Core.Diagnostics;
67
using Azure.Identity;
78
using Azure.Storage.Blobs;
89
using Azure.Storage.Blobs.Models;
@@ -54,6 +55,8 @@ private void ExecuteCore()
5455
StorageAccount = "https://" + StorageAccount + ".blob.core.windows.net";
5556
}
5657

58+
using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger();
59+
5760
DefaultAzureCredential credential;
5861
DefaultAzureCredentialOptions credentialoptions;
5962

src/UploadIndexStage1/Program.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Text;
77
using System.Threading.Tasks;
88
using Azure.Core;
9+
using Azure.Core.Diagnostics;
910
using Azure.Identity;
1011
using Azure.Storage.Blobs;
1112
using Azure.Storage.Blobs.Models;
@@ -65,6 +66,8 @@ static async Task Main(string[] args)
6566
storageAccount = "https://" + storageAccount + ".blob.core.windows.net";
6667
}
6768

69+
using AzureEventSourceListener listener = AzureEventSourceListener.CreateConsoleLogger();
70+
6871
DefaultAzureCredential credential;
6972
DefaultAzureCredentialOptions credentialoptions;
7073

0 commit comments

Comments
 (0)