User profile pictures. The recommended size is 64x64 px.

Avoid table updates; instead, delete and insert a new row to replace a user's photo. Otherwise, browsers may display a cached version of the old photo.

The Microsoft Graph component has a code example on importing profile photos from Graph.

About ETags

If you're fetching photos over HTTP you can use an ETag together with the If-None-Match header to only download images that have changed.

If the server you're fetching photos from does not support ETag then you may be able to use the If-Modified-Since header instead.

Add row: Allowed
Delete row: Allowed
Foreign key: Not allowed


Name Datatype Read Write Primary key Description
UserPhotoId uniqueidentifier Yes No Yes The photo's ID. There is a DEFAULT-constraint on this column.
UserId int Yes Yes No The user the photo depicts. There is a UNIQUE constraint on this column - a user can have at most one profile photo.
UserPhoto varbinary(max) Yes Yes No The photo.
UserPhotoContentType varchar(300) Yes Yes No MIME-type of the photo.
ETag varchar(300) Yes Yes No The ETag value assigned to the image by the server you fetched it from, if any.
UpdateDatetime datetimeoffset Yes Yes No Last time the photo was changed.