<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def upload(self, storagemodel:object, modeldefinition = None):
 """ insert blob message into storage """


        if (storagemodel.content is None) or (storagemodel.properties.content_settings.content_type is None):
            # No content to upload
            raise AzureStorageWrapException(storagemodel, "StorageBlobModel does not contain content nor content settings")

        else:
            blobservice = modeldefinition['blobservice']
            container_name = modeldefinition['container']
            blob_name = storagemodel.name

            try:

                # refresh metadata
                storagemodel.__instance_to_metadata__()

                """ upload bytes """
                blobservice.create_blob_from_bytes(
                        container_name=container_name, 
                        blob_name=blob_name, 
                        blob=storagemodel.content, 
                        metadata=storagemodel.metadata, 
                        content_settings=storagemodel.properties.content_settings
                    )

                storagemodel.properties = blobservice.get_blob_properties(container_name=container_name, blob_name=blob_name).properties
                 
            except Exception as e:
                msg = 'can not save blob in container {} because {!s}'.format(storagemodel._containername, e)
                raise AzureStorageWrapException(storagemodel, msg=msg)
           
        return storagemodel