Редагувати

Поділитися через


Tutorial: Define custom metadata

In this tutorial, define custom metadata to help you organize your APIs and other information in your API center. Use custom and built-in metadata for search and filtering and to enforce governance standards in your organization.

For background information about metadata in Azure API Center, see:

In this tutorial, you learn how to use the portal to:

  • Define custom metadata in your API center
  • View the metadata schema

Prerequisites

Define metadata

Here you define two custom metadata examples: Line of business and Public-facing; if you prefer, define other metadata of your own. When you add or update APIs and other information in your inventory, you'll set values for custom and any common built-in metadata.

Important

Don't include any sensitive, confidential, or personal information in the titles (names) of metadata you define. These titles are visible in monitoring logs that are used by Microsoft to improve the functionality of the service. However, other metadata details and values are your protected customer data.

  1. In the Azure portal, navigate to your API center.

  2. In the left menu, under Assets, select Metadata > + New metadata.

  3. On the Details tab, enter information about the metadata.

    1. In Title, enter Line of business.

    2. Optionally, enter a Description.

    3. Select type Predefined choices and enter choices such as Marketing, Finance, IT, Sales, and so on. Optionally enable Allow selection of multiple values. Select Next.

    Screenshot of adding custom metadata in the portal.

  4. On the Assignments tab, select Required for APIs. Select Optional for Deployments and Environments. (You'll add these entities in later tutorials.) Select Next.

    Screenshot of metadata assignments in the portal.

  5. On the Review + create tab, review the settings and select Create.

    The metadata is added to the list on the Metadata page.

  6. Select + New metadata to add another example.

  7. On the Details tab, enter information about the metadata.

    1. In Title, enter Public-facing.

    2. Select type Boolean.

  8. On the Assignments tab, select Required for APIs. Select Not applicable for Deployments and Environments.

  9. On the Review + create tab, review the settings and select Create.

    The metadata is added to the list.

View metadata schema

You can view and download the JSON schema for the metadata defined in your API center. The schema includes built-in and custom metadata.

  1. In the left menu, under Assets, select Metadata > View metadata schema.

  2. Select View metadata schema > APIs to see the metadata schema for APIs, which includes built-in and custom metadata. You can also view the metadata schema defined for deployments and environments in your API center.

    Screenshot of metadata schema in the portal.

Next steps

In this tutorial, you learned how to use the portal to:

  • Define custom metadata in your API center
  • View the metadata schema

Now that you've prepared your metadata schema, add APIs to the inventory in your API center.