diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index 58e36e692e..f9854e247f 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -979,6 +979,9 @@ function &drupal_static($name, $default_value = NULL, $reset = FALSE) {
  *   unit tests with a clean environment.
  */
 function drupal_static_reset($name = NULL) {
+  if ($name === 'taxonomy_vocabulary_get_names') {
+    @trigger_error("Using drupal_static_reset() with 'taxonomy_vocabulary_get_names' as parameter is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. There's no replacement for this usage. See https://www.drupal.org/node/3039041.", E_USER_DEPRECATED);
+  }
   drupal_static($name, NULL, TRUE);
 }
 
diff --git a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
index eb1bc5a47b..29ea8d6314 100644
--- a/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_default/Tid.php
@@ -81,7 +81,8 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
     // @todo Remove the legacy code.
     // Convert legacy vids option to machine name vocabularies.
     if (!empty($this->options['vids'])) {
-      $vocabularies = taxonomy_vocabulary_get_names();
+      $vids = array_keys($this->vocabularyStorage->loadMultiple());
+      $vocabularies = array_combine($vids, $vids);
       foreach ($this->options['vids'] as $vid) {
         if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
           $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
diff --git a/core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php b/core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php
index 7ffbba7b39..2342becb63 100644
--- a/core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument_validator/Term.php
@@ -20,7 +20,8 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
     // @todo Remove the legacy code.
     // Convert legacy vids option to machine name vocabularies.
     if (!empty($this->options['vids'])) {
-      $vocabularies = taxonomy_vocabulary_get_names();
+      $vids = array_keys($this->entityTypeManager->getStorage('taxonomy_vocabulary')->loadMultiple());
+      $vocabularies = array_combine($vids, $vids);
       foreach ($this->options['vids'] as $vid) {
         if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
           $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
diff --git a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
index 5a88acea4d..260cbb9603 100644
--- a/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
+++ b/core/modules/taxonomy/src/Plugin/views/relationship/NodeTermData.php
@@ -64,7 +64,8 @@ public function init(ViewExecutable $view, DisplayPluginBase $display, array &$o
     // @todo Remove the legacy code.
     // Convert legacy vids option to machine name vocabularies.
     if (!empty($this->options['vids'])) {
-      $vocabularies = taxonomy_vocabulary_get_names();
+      $vids = array_keys($this->vocabularyStorage->loadMultiple());
+      $vocabularies = array_combine($vids, $vids);
       foreach ($this->options['vids'] as $vid) {
         if (isset($vocabularies[$vid], $vocabularies[$vid]->machine_name)) {
           $this->options['vocabularies'][$vocabularies[$vid]->machine_name] = $vocabularies[$vid]->machine_name;
diff --git a/core/modules/taxonomy/src/VocabularyStorage.php b/core/modules/taxonomy/src/VocabularyStorage.php
index ce90189b58..e9b32ebd22 100644
--- a/core/modules/taxonomy/src/VocabularyStorage.php
+++ b/core/modules/taxonomy/src/VocabularyStorage.php
@@ -9,14 +9,6 @@
  */
 class VocabularyStorage extends ConfigEntityStorage implements VocabularyStorageInterface {
 
-  /**
-   * {@inheritdoc}
-   */
-  public function resetCache(array $ids = NULL) {
-    drupal_static_reset('taxonomy_vocabulary_get_names');
-    parent::resetCache($ids);
-  }
-
   /**
    * {@inheritdoc}
    */
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 160bcbe635..f5f3bd184e 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -307,20 +307,17 @@ function taxonomy_vocabulary_static_reset(array $ids = NULL) {
  *
  * @return array
  *   A list of existing vocabulary IDs.
+ *
+ * @deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use
+ *   \Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')->loadMultiple()
+ *   instead, to get a list of vocabulary entities keyed by vocabulary ID.
+ *
+ * @see https://www.drupal.org/node/3039041
  */
 function taxonomy_vocabulary_get_names() {
-  $names = &drupal_static(__FUNCTION__);
-
-  if (!isset($names)) {
-    $names = [];
-    $config_names = \Drupal::configFactory()->listAll('taxonomy.vocabulary.');
-    foreach ($config_names as $config_name) {
-      $id = substr($config_name, strlen('taxonomy.vocabulary.'));
-      $names[$id] = $id;
-    }
-  }
-
-  return $names;
+  @trigger_error('taxonomy_vocabulary_get_names() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getStorage("taxonomy_vocabulary")->loadMultiple() instead, to get a list of vocabulary entities keyed by vocabulary ID. See https://www.drupal.org/node/3039041.', E_USER_DEPRECATED);
+  $vids = array_keys(\Drupal::entityTypeManager()->getStorage('taxonomy_vocabulary')->loadMultiple());
+  return array_combine($vids, $vids);
 }
 
 /**
@@ -340,14 +337,7 @@ function taxonomy_vocabulary_get_names() {
 function taxonomy_term_load_multiple_by_name($name, $vocabulary = NULL) {
   $values = ['name' => trim($name)];
   if (isset($vocabulary)) {
-    $vocabularies = taxonomy_vocabulary_get_names();
-    if (isset($vocabularies[$vocabulary])) {
-      $values['vid'] = $vocabulary;
-    }
-    else {
-      // Return an empty array when filtering by a non-existing vocabulary.
-      return [];
-    }
+    $values['vid'] = $vocabulary;
   }
   return \Drupal::entityTypeManager()->getStorage('taxonomy_term')->loadByProperties($values);
 }
diff --git a/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php b/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
index b39684c2f6..7ce743eaec 100644
--- a/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
+++ b/core/modules/taxonomy/tests/src/Kernel/VocabularyCrudTest.php
@@ -92,11 +92,6 @@ public function testTaxonomyVocabularyLoadMultiple() {
     $this->assertEquals('bar', $vocabulary2->getThirdPartySetting('taxonomy_crud', 'foo'));
     $this->assertEquals('bar', $vocabulary3->getThirdPartySetting('taxonomy_crud', 'foo'));
 
-    // Fetch the names for all vocabularies, confirm that they are keyed by
-    // machine name.
-    $names = taxonomy_vocabulary_get_names();
-    $this->assertEquals($vocabulary1->id(), $names[$vocabulary1->id()]);
-
     // Fetch the vocabularies with Vocabulary::loadMultiple(), specifying IDs.
     // Ensure they are returned in the same order as the original array.
     $vocabularies = Vocabulary::loadMultiple([
diff --git a/core/modules/taxonomy/tests/src/Unit/TaxonomyVocabularyTest.php b/core/modules/taxonomy/tests/src/Unit/TaxonomyVocabularyTest.php
new file mode 100644
index 0000000000..56914a50fc
--- /dev/null
+++ b/core/modules/taxonomy/tests/src/Unit/TaxonomyVocabularyTest.php
@@ -0,0 +1,44 @@
+<?php
+
+namespace Drupal\Tests\taxonomy\Unit;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\taxonomy\VocabularyStorage;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * @group taxonomy
+ */
+class TaxonomyVocabularyTest extends UnitTestCase {
+
+  /**
+   * @group legacy
+   * @expectedDeprecation taxonomy_vocabulary_get_names() is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. Use \Drupal::entityTypeManager()->getStorage("taxonomy_vocabulary")->loadMultiple() instead, to get a list of vocabulary entities keyed by vocabulary ID. See https://www.drupal.org/node/3039041.
+   * @see taxonomy_vocabulary_get_names()
+   */
+  public function testTaxonomyVocabularyGetNamesDeprecation() {
+    $container = new ContainerBuilder();
+    $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
+    $vocabulary_storage = $this->prophesize(VocabularyStorage::class);
+    $vocabulary_storage->loadMultiple()->willReturn([]);
+    $entity_type_manager->getStorage('taxonomy_vocabulary')
+      ->willReturn($vocabulary_storage->reveal());
+    $container->set('entity_type.manager', $entity_type_manager->reveal());
+    \Drupal::setContainer($container);
+
+    require_once $this->root . '/core/modules/taxonomy/taxonomy.module';
+    taxonomy_vocabulary_get_names();
+  }
+
+  /**
+   * @group legacy
+   * @expectedDeprecation Using drupal_static_reset() with 'taxonomy_vocabulary_get_names' as parameter is deprecated in Drupal 8.8.0 and will be removed before Drupal 9.0.0. There's no replacement for this usage. See https://www.drupal.org/node/3039041.
+   * @see drupal_static_reset()
+   */
+  public function testTaxonomyVocabularyGetNamesCacheResetDeprecation() {
+    require_once $this->root . '/core/includes/bootstrap.inc';
+    drupal_static_reset('taxonomy_vocabulary_get_names');
+  }
+
+}
