Create Text Field Programmatically to Media Type
In Drupal 7 fields were shared across all content types; in Drupal 8 they're shared across a single entity type.

As such you've just missed the entity_type when creating the storage:

$field = FieldStorageConfig::create(array(
  'entity_type' =&gt; 'file',
  'field_name' =&gt; $field_name,
  'type' =&gt; 'text',
  'settings' =&gt; array('max_length' =&gt; 64),
));


As an aside, hook_update_N is for updates only, those functions won't be executed upon install. The point of them is to allow older versions of the module to get up to date with the current version that they're upgrading to. The initial state of the latest version of the module should reflect the state the older version of the module would be in after the update. 

You can use hook_install or config files in config/install/*.yml to perform initial setup of your module upon install.