'Update tags on any resource supporting tags.
:param resource: The resource to update.
:type resource: ``str`` or Azure object with an ``id`` attribute.
:param tags: The tags to set.
:type tags: ``dict``
:param replace: If true, replace all tags with the new tags.
If false (default) add or update tags.
:type replace: ``bool``'

def ex_create_tags(self, resource, tags, replace=False):

    if (not isinstance(resource, basestring)):
        resource = resource.id
    r = self.connection.request(resource, params={'api-version': '2015-06-15'})
    if replace:
        r.object['tags'] = tags
    else:
        r.object['tags'].update(tags)
    r = self.connection.request(resource, data={'tags': r.object['tags']}, params={'api-version': '2015-06-15'}, method='PATCH')
