Stay organized with collections
Save and categorize content based on your preferences.
Vertex ML Metadata lets you track and analyze the metadata
produced by your machine learning (ML) workflows. The first time you run a
PipelineJob or create an experiment in the Vertex SDK, Vertex AI creates
your project's
MetadataStore.
If you want your metadata encrypted using a customer-managed encryption key
(CMEK), you must create your metadata store using a CMEK before you use
Vertex ML Metadata to track or analyze metadata.
After the metadata store has been created, the CMEK key that the metadata store
uses is independent of the CMEK key used by processes that log metadata,
for example, a pipeline run.
Create a metadata store that uses a CMEK
Use the following instructions to create a CMEK and set up a
Vertex ML Metadata metadata store that uses this CMEK.
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Save the request body in a file named request.json.
Run the following command in the terminal to create or overwrite
this file in the current directory:
Save the request body in a file named request.json.
Run the following command in the terminal to create or overwrite
this file in the current directory:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Configure your project's metadata store\n\nVertex ML Metadata lets you track and analyze the metadata\nproduced by your machine learning (ML) workflows. The first time you run a\nPipelineJob or create an experiment in the Vertex SDK, Vertex AI creates\nyour project's\n.\n\nIf you want your metadata encrypted using a [customer-managed encryption key\n(CMEK)](/vertex-ai/docs/general/cmek), you must create your metadata store using a CMEK *before* you use\nVertex ML Metadata to track or analyze metadata.\n\nAfter the metadata store has been created, the CMEK key that the metadata store\nuses is independent of the CMEK key used by processes that log metadata,\nfor example, a pipeline run.\n\nCreate a metadata store that uses a CMEK\n----------------------------------------\n\nUse the following instructions to create a CMEK and set up a\nVertex ML Metadata metadata store that uses this CMEK.\n\n1. [Use Cloud Key Management Service to configure a customer-managed encryption\n key.](/vertex-ai/docs/general/cmek#configure-cmek)\n\n2. Use the following REST call to create your project's default metadata store\n using your CMEK.\n\n\n Before using any of the request data,\n make the following replacements:\n - \u003cvar translate=\"no\"\u003eLOCATION_ID\u003c/var\u003e: Your region.\n - \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: Your [project ID](/resource-manager/docs/creating-managing-projects#identifiers).\n - \u003cvar translate=\"no\"\u003eKEY_RING\u003c/var\u003e: The name of the Cloud Key Management Service key ring that your encryption key is on.\n - \u003cvar translate=\"no\"\u003eKEY_NAME\u003c/var\u003e: The name of the encryption key that you want to use for this metadata store.\n\n\n HTTP method and URL:\n\n ```\n POST https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/metadataStores?metadata_store_id=default\n ```\n\n\n Request JSON body:\n\n ```\n {\n \"encryption_spec\": {\n \"kms_key_name\": \"projects/PROJECT_ID/locations/LOCATION_ID/keyRings/KEY_RING/cryptoKeys/KEY_NAME\"\n },\n }\n ```\n\n To send your request, expand one of these options:\n\n #### curl (Linux, macOS, or Cloud Shell)\n\n | **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) , or by using [Cloud Shell](/shell/docs), which automatically logs you into the `gcloud` CLI . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\n Save the request body in a file named `request.json`.\n Run the following command in the terminal to create or overwrite\n this file in the current directory: \n\n ```\n cat \u003e request.json \u003c\u003c 'EOF'\n {\n \"encryption_spec\": {\n \"kms_key_name\": \"projects/PROJECT_ID/locations/LOCATION_ID/keyRings/KEY_RING/cryptoKeys/KEY_NAME\"\n },\n }\n EOF\n ```\n\n\n Then execute the following command to send your REST request:\n\n ```\n curl -X POST \\\n -H \"Authorization: Bearer $(gcloud auth print-access-token)\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n -d @request.json \\\n \"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/metadataStores?metadata_store_id=default\"\n ```\n\n #### PowerShell (Windows)\n\n | **Note:** The following command assumes that you have logged in to the `gcloud` CLI with your user account by running [`gcloud init`](/sdk/gcloud/reference/init) or [`gcloud auth login`](/sdk/gcloud/reference/auth/login) . You can check the currently active account by running [`gcloud auth list`](/sdk/gcloud/reference/auth/list).\n\n\n Save the request body in a file named `request.json`.\n Run the following command in the terminal to create or overwrite\n this file in the current directory: \n\n ```\n @'\n {\n \"encryption_spec\": {\n \"kms_key_name\": \"projects/PROJECT_ID/locations/LOCATION_ID/keyRings/KEY_RING/cryptoKeys/KEY_NAME\"\n },\n }\n '@ | Out-File -FilePath request.json -Encoding utf8\n ```\n\n\n Then execute the following command to send your REST request:\n\n ```\n $cred = gcloud auth print-access-token\n $headers = @{ \"Authorization\" = \"Bearer $cred\" }\n\n Invoke-WebRequest `\n -Method POST `\n -Headers $headers `\n -ContentType: \"application/json; charset=utf-8\" `\n -InFile request.json `\n -Uri \"https://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/metadataStores?metadata_store_id=default\" | Select-Object -Expand Content\n ```\n\n You should receive a JSON response similar to the following:\n\n ```\n {\n \"name\": \"projects/PROJECT_ID/locations/LOCATION_ID/operations/OPERATIONS_ID\",\n \"metadata\": {\n \"@type\": \"type.googleapis.com/google.cloud.aiplatform.v1.CreateMetadataStoreOperationMetadata\",\n \"genericMetadata\": {\n \"createTime\": \"2021-05-18T18:47:14.494997Z\",\n \"updateTime\": \"2021-05-18T18:47:14.494997Z\"\n }\n }\n }\n ```\n\n \u003cbr /\u003e"]]