Sqlserver The Logical Filename is already in use when trying to add datafile

While adding an extra datafile to a tempdb I received the following popup. 

Logical filename already in use

Apparently the internal administration is messed up and Sqlserver still thinks that a file is still part of the database file administration but this is not anymore the case.

Use the following query:

SELECT * 
FROM sys.master_files
WHERE DB_NAME(database_id) = 'tempdb'

Even though we can see multiple datafile for the tempdb, in management studio we can only see 2 that are actually active.

This situation can start to present itself when one decides to provision a database server on Azure to server with less CPU’s. The database files where created in a different context and every time the server is provisioned the default setting of one tempdb file and one tempdb logfile are created. If you want to add extra datafiles you will first have to remove them from the administration with the query: alter database tempdb
remove file temp2.

If necessary  you can add the datafile once again without the popup.