Microsoft Teams data collection

Microsoft Teams is one if not the most used communication software during this pandemic. Most companies, schools and other organizations quickly started implementing Microsoft Teams as their main way of communicating in order to be as flexible as possible. Most often than not, this implementation was done for efficiency and was not thought over in other aspects than needing to stay in contact with each other. One of these aspects, is data gathering. Microsoft Teams collects a lot of different types of data about each user and its device.

Which data is being collected?

Currently, Teams gathers the same data as Skype for Business. The data is categorized into three different types. Census data, which is information about the user’s system, such as operating system, hardware and system language. This so called census data is linked to a generated user ID which is hashed for security and privacy reasons.

Then there is usage data, that describes the number of messages sent, calls and meetings joined, and the name of the organization by which your instance of Teams is registered.

Teams also stores profile data such as your profile picture, email address and phone number. Communication relevant information is also gathered. This relates to the content of meetings, including shared files, recordings and transcripts. The latter is stored on a shared cloud instance of an organization, so the users can access it. This data is retained on the cloud until the user deletes it or stops using Microsoft Teams. For individual users, that do not belong to an organization, the data deleted after 30 days.

Information which the administrators can access

Microsoft also allows company administrators to access analysis on how the users of an organization utilize the software. This data consists of activity reports, like how many messages, calls where performed by a user and also when. They can also see how many meetings a user was in, how many meetings were organized, how much time was spent communicating with audio, how much time through video and how much time a user shared his screen.

Conclusion

In the end, Teams collects a very large amount of data from its users, but it is not a novelty in the Microsoft world. Most of the data collected does not deviate from the standards that Microsoft has for data gathering on other services. One Drive, Office and the Windows operating system can collect even more data than what Teams is currently collecting.

It is still possible to keep some of your usage data private, but this is more easily accomplished if you are not registered on Teams through an organization, otherwise, you will have to ask the company administrators to look into that.

EF Core Model builder

EF Core is a very versatile tool to allow your .NET applications to integrate a database connection and management.

For this blogpost, I will be explaining some of the less known features of the ModelBuilder class.

Model Builder?

The ModelBuilder class is a special class which will normally only be used for the setup of your database context. The DbContext class processes a method called OnModelCreating, which takes an implementation of the IModelBuilder interface as a parameter but as your own context class is inheriting this method from the DbContext base class, the parameter will be fed to the method through the other framework features. The IModelBuilder interface describes all the usable/public methods of the ModelBuilder class and this can be used to further detail the setup of your models.

As per usual, you would create a set of POCOs called Entities that would be a representation of your desired tables in a database. These entities would then be declared in your DbContext class as properties and then you would already have access to the database and start reading and writing data.

The ModelBuilder provides your with methods and ways to take the mapping made by EF Core between Entities and Tables into your own hands.

The methods

HasColumnName()

The HasColumnName method allows you to define which property of an entity, relates to which column. As matter of fact, this actually means that you could configure to have different names on a table in comparison to your entities. But this feature is mostly utilized for mapping purposes, such as when you already have a database with data and want to connect your own entities to the different tables. A good example for this, is when you develop an app for an existing database, which by some ungodly reason, has column names in another language.

HasColumnType()

With this handy method, you can bypass the default column types that EF Core maps. For example, EF Core maps strings to nvarchar but you can override it to map it to the simpler varchar.

HasDefaultValue()

If you want to control what happens when the value for a certain property on an entity is not set, then this method is for you. You can easily set what EF should insert into a table if a value is not provided to the entity.

ValueGeneratedNever()

ValueGeneratedNever is the dictator of primary keys and other types that a EF sets as auto-generated by default. If you wish to work with GUIDs as IDs instead of the typical integer, this method is the way to go.