Skip to content
This repository was archived by the owner on Jul 21, 2025. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/ADOGenerator/ADOGenerator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@
</ItemGroup>
<ItemGroup>

<PackageReference Include="Microsoft.Identity.Client" Version="4.66.2" />
<PackageReference Include="Microsoft.Identity.Client" Version="4.70.0" />

<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="9.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="9.0.3" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.3" />

<PackageReference Include="Microsoft.VisualStudio.Services.Client" Version="19.225.1" />
<PackageReference Include="Microsoft.VisualStudio.Services.ExtensionManagement.WebApi" Version="19.225.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Data.SqlClient" Version="4.9.0" />
<PackageReference Include="System.Formats.Asn1" Version="9.0.0" />
<PackageReference Include="System.Formats.Asn1" Version="9.0.3" />
<PackageReference Include="System.Net.Http" Version="4.3.4" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
</ItemGroup>
Expand Down
14 changes: 11 additions & 3 deletions src/ADOGenerator/ServiceExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,20 @@ public static void AddMessage(this string id, string message)
string fileName = $"{DateTime.Now.ToString("yyyy-MM-dd")}-{id}.txt";
if (id.EndsWith("_Errors"))
{
// Create the Errors folder if it does not exist
string errorsFolderPath = Path.Combine(logFilePath, "Errors");
if (!Directory.Exists(errorsFolderPath))
{
Directory.CreateDirectory(errorsFolderPath);
}
// Create Log file
if (!File.Exists(Path.Combine(logFilePath, "Errors", fileName)))
string errorFilePath = Path.Combine(errorsFolderPath, fileName);
if (!File.Exists(errorFilePath))
{
File.Create(Path.Combine(logFilePath, "Errors", fileName)).Dispose();
File.Create(errorFilePath).Dispose();
}
File.AppendAllLines(Path.Combine(logFilePath, "Errors", fileName), new string[] { message });
File.AppendAllLines(errorFilePath, new string[] { message });

Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine(message);
Console.ResetColor();
Expand Down
26 changes: 22 additions & 4 deletions src/ADOGenerator/Services/AuthService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,30 @@ static AuthService()

public async Task<AuthenticationResult> AcquireTokenAsync(IPublicClientApplication app)
{
AuthenticationResult result = null;
try
{
result = await app.AcquireTokenWithDeviceCode(scopes, deviceCodeCallback =>
{
Console.WriteLine(deviceCodeCallback.Message);
return Task.CompletedTask;
}).ExecuteAsync();
}
catch (MsalServiceException ex)
{
Console.WriteLine($"MSALServiceException Error: {ex.Message} \nError Code: {ex.ErrorCode}");

return await app.AcquireTokenWithDeviceCode(scopes, deviceCodeCallback =>
}
catch (OperationCanceledException ex)
{
Console.WriteLine(deviceCodeCallback.Message);
return Task.CompletedTask;
}).ExecuteAsync();
Console.WriteLine($"OperationCanceledException Error: {ex.Message}");
}
catch (MsalClientException ex)
{
Console.WriteLine($"MSALClientException Error: {ex.Message} \nError Code: {ex.ErrorCode}");
}

return result; // Ensure a return value in case of an exception
}

public async Task<string> GetProfileInfoAsync(string accessToken)
Expand Down
6 changes: 3 additions & 3 deletions src/ADOGenerator/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
"GraphApiVersion": "4.1-preview.1",
"VariableGroupsApiVersion": "5.0-preview.1",
"AnalyticsKey": "",
"clientId": "",
"tenantId": "",
"scopes": ""
"clientId": "1e5741a9-65b0-41ee-aa63-bd885846e612",
"tenantId": "4dc36e62-3c28-4030-9bb2-3b85837b552e",
"scopes": "499b84ac-1321-427f-aa17-267ca6975798/.default"
},
"Logging": {
"LogLevel": {
Expand Down
2 changes: 1 addition & 1 deletion src/API/API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="log4net" Version="3.0.3" />
<PackageReference Include="log4net" Version="3.0.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.Threading" Version="4.3.0" />
</ItemGroup>
Expand Down
Loading