Skip to main content

Posts

Architecture Weekly

Interested in software architecture? I discovered ‘Architecture Weekly’ , a weekly list of links so you know what to read during the weekend.

C#–Hide a base class for usage outside an assembly

I created an abstract base class in C# but didn’t want it to be used outside the assembly I created it in. How can you achieve this? Your first guess could be to change the access modifier of the base class to internal . When you try to do this you’ll get the following error message: Inconsistent accessibility: base class 'MyBaseClass' is less accessible than class 'MyInheritedClass' You have no other choice than to make the abstract class public what makes it visible outside the assembly. Is there still a way to only allow classes in the same assembly to implement it? The trick is to make the abstract base class public , but give it an internal default constructor: This will allow MyBaseClass to be visible outside the assembly, but classes outside the assembly cannot inherit from it.

Azure DevOps–Auditing streams

Yesterday I blogged about Azure DevOps audit logs .  Although you could export the logs, it was only limited to the last 90 days. To have a full audit log over time, we need to take a different approach through audit streams. Audit streams represent a pipeline that flows audit events from your Azure DevOps organization to a stream target. Every half hour or less, new audit events are bundled and streamed to your targets. Currently, the following stream targets are available for configuration: Splunk – Connect to on-premises or cloud-based Splunk. Azure Monitor Log - Send auditing logs to Azure Monitor Logs . Logs stored in Azure Monitor Logs can be queried and have alerts configured. Look for the table named AzureDevOpsAuditing. You can also connect Azure Sentinel to your workspace. Azure Event Grid – For scenarios where you want your auditing logs to be sent somewhere else, whether inside or outside of Azure, you can set up an Azure Event Grid connection. ...

Azure DevOps–Auditing

A lesser known feature in Azure DevOps Services(it doesn’t exist in Azure DevOps) is the audit log. The audit log contains many changes that occur throughout an Azure DevOps organization. The feature is still in preview and the list of events that are tracked through this feature keeps growing. Check the audit logs Let’s find out how to check the audit log: Sign in to your organization ( https://dev.azure.com/{yourorganization } ). Select Organization settings in the bottom left corner. Select Auditing from the left menu . The auditing page gives you a limited view into the available audit events and recorded data. If you want to access all the data, it is possible to export the data.  Click on the Export log button in the right corner. Remark: If you can't find the auditing event you're looking for in the following table, be sure to check the REST API: https://auditservice.dev.azure.com/{YOUR_ORGANIZATION}/_apis/audit/actions . Rep...

The Art of Computers

Scott Hanselman is always entertaining but if you are new to programming or not, this is a great talk about some important concepts in IT:

ASP.NET HttpHandler - Concurrent requests

To solve a specific issue(maybe more about this in another post) we created a custom HttpHandler in ASP.NET. Inside this handler we need access to the session. Therefore we implemented the IRequiresSessionState marker interface: The HttpHandler worked as expected until we started to increase the load. We noticed that a lot of requests remained pending… This could be traced to the usage of the IRequiresSessionState that put an exclusive lock on the current session. As a consequence the # of concurrent requests for one user are restriced. The good news is that another marker interface exists, IReadOnlySessionState , that does not acquire an exclusive lock. In case you only need to read data from the session state and don’t need to change any session data, you can switch to this interface:

Kubernetes–Schedule a pod on a Linux node–Part 2

Yesterday I blogged about the usage of the “kubernetes.io/os” nodeselector to schedule a pod specifically on a windows or linux node pool. Today I want to share another way through the usage of taints and tolerations. This Kubernetes feature allows users to mark a node (taint the node) so that no pods can be scheduled to it, unless a pod has a toleration that indicates it will accept this taint. Using this Kubernetes feature we can create nodes that are reserved (dedicated) for specific pods.  Using this, we can pick one OS and taint all the nodes with this OS, so that any pods that do not specify toleration will use the non-tainted nodes. This Taint effectively allows us to specify a default OS for the cluster, and if you want to use the other OS, you need to state this explicitly. To enable this, we first need to taint our Windows nodes. We would run this command for each Windows node: kubectl taint nodes <nodeName> OS=Windows:NoSchedule After this is applied it...