-
Notifications
You must be signed in to change notification settings - Fork 0
English
- SQL Server
- .Net Core 3.1+ Application
- Azure DevOps Account
PM > Install-Package AzureDevOpsTracker -Version 1.0.1Once the nuget is installed, update the Startup.cs OWIN file of your .net application with the code ahead:
public void ConfigureServices(IServiceCollection services)
{
services.AddAzureDevopsStateTracker(new AzureDevopsStateTracker.Data.DataBaseConfig("[CONNECTION_STRING]"));
}
public void Configure(IApplicationBuilder app, IServiceProvider serviceProvider)
{
app.UseAzureDevopsStateTracker(serviceProvider);
}For more informations about additional options when configuring the Azure DevOps Tracker in startup go to Adding services.
For the Azure DevOps Service Hook Integration, it is necessary that your application has/have two EndPoints to receive a POST HTTP Request with a specific Json. These endpoints will receive Workitems data when it is created or updated.
public class ExampleController : Controller
{
private readonly IAzureDevopsTrackerService _azureDevopsTrackerService;
public ExampleController(
IAzureDevopsTrackerService azureDevopsTrackerService)
{
_azureDevopsTrackerService = azureDevopsTrackerService;
}
[HttpPost("workitem-updated")]
public async Task<IActionResult> WorkItemUpdated([FromBody] UpdatedWorkItemDTO updatedWorkItemDTO)
{
await _azureDevopsTrackerService.Update(updatedWorkItemDTO);
return Ok();
}
[HttpPost("workitem-created")]
public async Task<IActionResult> WorkItemCreated([FromBody] CreateWorkItemDTO createWorkItemDTO)
{
await _azureDevopsTrackerService.Create(createWorkItemDTO);
return Ok();
}
}For more informations and an example about the Azure DevOps Tracker in a Azure Function, visit our repository Azure DevOps Function Tracker.
]
]
]
The same steps has to be done to “WorkItem Updated”.
That’s it! Now all changes made to WorkItems will be automatically saved in the database!! 🎉😍