How can create a block that get a field value and render it? I'm trying to create a simple block that have some link fields. those links have some predefined values and after get any new values from the admin replace with values and then render that values to the theme:
my_module\src\Plugin\Block\MyBlock:

&lt;?php

namespace Drupal\my_modules\Plugin\Block;

use Drupal\Core\Block\BlockBase;
use Drupal\Core\Block\BlockPluginInterface;
use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\Url;


/**
 * @Block(
 *   id = "my_block",
 *   admin_label = @Translation("My Block"),
 *   category = @Translation("My Block")
 * )
 */
class MyBlock extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function defaultConfiguration() {
    // set default link field value.
    return array(
      'default_LinkA_url' =&gt; ('http://www.LinkA.com/'),
      'default_LinkB_url' =&gt; ('http://www.LinkB.com/'),
    );
  }

  /**
   * {@inheritdoc}
   */
  public function blockForm($form, FormStateInterface $form_state) {
    // Add a form field to the existing block configuration form.

  $form['block_LinkA_url'] = array(
    '#type' =&gt; 'url',
    '#title' =&gt; t('Link A:'),
    '#size' =&gt; 60,
    '#default_value' =&gt; $this-&gt;configuration['default_LinkA_url'],
  );
  $form['block_LinkB_url'] = array(
    '#type' =&gt; 'url',
    '#title' =&gt; t('Link B:'),
    '#size' =&gt; 60,
    '#default_value' =&gt; $this-&gt;configuration['default_LinkB_url'],
  );
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function blockSubmit($form, FormStateInterface $form_state) {
    // Save our custom settings when the form is submitted.
    $this-&gt;setConfigurationValue['default_LinkA_url']
      = $form_state-&gt;getValue('block_LinkA_url');

    $this-&gt;setConfigurationValue['default_LinkB_url']
      = $form_state-&gt;getValue('block_LinkB_url');
  }



  /**
   * {@inheritdoc}
   */
  public function build() {
    return (
      '#markup' =&gt; $this-&gt;configuration['default_LinkA_url'],
      '#markup' =&gt; $this-&gt;configuration['default_LinkB_url'],
    );
  }
}


whatsoever I try I cant get any result, I would be happy to hear what the problem is.
If you use setConfigurationValue(), put the value as parameter in the function:

$this-&gt;setConfigurationValue('default_LinkA_url', $form_state-&gt;getValue('block_LinkA_url'));


Or better set the value in the configuration array like this:

$this-&gt;configuration['default_LinkA_url'] = $form_state-&gt;getValue('block_LinkA_url');


To display the url use the render element link:

https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Render!Element!Link.php/class/Link/8.2.x