def server_update( instance, administrator_login_password=None, assign_identity=False): # Once assigned, the identity cannot be removed if instance.identity is None and assign_identity: instance.identity = ResourceIdentity(type=IdentityType.system_assigned.value) # Apply params to instance instance.administrator_login_password = ( administrator_login_password or instance.administrator_login_password) return instance
def server_create(client, resource_group_name, server_name, assign_identity=False, **kwargs): if assign_identity: kwargs['identity'] = ResourceIdentity( type=IdentityType.system_assigned.value) # Create return client.create_or_update(server_name=server_name, resource_group_name=resource_group_name, parameters=kwargs)