Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Ti consigliamo di accedere all'API Secret Manager utilizzando i seguenti strumenti:
Google Cloud CLI, che fornisce un'interfaccia a riga di comando per la gestione dei secret.
Librerie client di Secret Manager pratiche e idiomatiche, che ti consentono di accedere e gestire i secret dal codice sorgente dell'applicazione. Inoltre, mette a disposizione librerie client in molti linguaggi, tra cui C#(.NET), Go, Java, Node.js, PHP, Python e Ruby.
Utilizzare Secret Manager con Compute Engine e Google Kubernetes Engine
Per utilizzare Secret Manager con i carichi di lavoro in esecuzione su Compute Engine o GKE, l'istanza o il nodo sottostante deve avere l'ambito OAuth cloud-platform. Se ricevi un messaggio di errore con il seguente messaggio, significa che non è stato eseguito il provisioning dell'istanza o del nodo con gli ambiti OAuth corretti.
Request had insufficient authentication scopes
L'ambito OAuth richiesto per utilizzare Secret Manager è:
Per utilizzare Secret Manager con i carichi di lavoro in esecuzione su App Engine, devi concedere tutte le autorizzazioni richieste al servizio App Engine.
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[],[],null,["# Access the Secret Manager API\n\nWe recommend that you access Secret Manager API using the following tools:\n\n- The [Google Cloud CLI](/sdk/gcloud/reference/secrets), which provides a\n command-line interface for managing secrets.\n\n- Convenient, idiomatic [Secret Manager client libraries](/secret-manager/docs/reference/libraries), which lets you access and manage\n secrets from within your application source code. Client libraries are available\n in many languages including C#(.NET), Go, Java, Node.js, PHP, Python, and Ruby.\n\nBefore you begin\n----------------\n\n1. [Enable the Secret Manager API](/secret-manager/docs/configuring-secret-manager).\n\n2. Requests to the Secret Manager API require authentication. For\n information, see\n [Set up authentication for Secret Manager](/secret-manager/docs/authentication#authn-how-to).\n\nUse Secret Manager with Compute Engine and Google Kubernetes Engine\n-------------------------------------------------------------------\n\nTo use Secret Manager with workloads running on Compute Engine\nor GKE, the underlying instance or node must have the\n`cloud-platform` OAuth scope. If you receive an error with the following\nmessage, it means the instance or node was not provisioned with the correct\nOAuth scopes. \n\n Request had insufficient authentication scopes\n\nThe required OAuth scope to use Secret Manager is: \n\n https://www.googleapis.com/auth/cloud-platform\n\nWhen creating a new instance, instance group, or node pool,\n[specify the `cloud-platform` scope](/compute/docs/access/create-enable-service-accounts-for-instances#using): \n\n### gcloud\n\n gcloud compute instances create \"\u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\" \\\n --scopes \"https://www.googleapis.com/auth/cloud-platform\"\n\nFor an existing instance, instance group, or node pool,\n[update the access scopes](/compute/docs/access/create-enable-service-accounts-for-instances#changeserviceaccountandscopes): \n\n### gcloud\n\n gcloud compute instances set-service-account \"\u003cvar translate=\"no\"\u003eINSTANCE_ID\u003c/var\u003e\" \\\n --service-account \"\u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_EMAIL\u003c/var\u003e\" \\\n --scopes \"https://www.googleapis.com/auth/cloud-platform\"\n\nSee the\n[Compute Engine service account permissions](/compute/docs/access/service-accounts#service_account_permissions)\nfor more information.\n\nUse Secret Manager with App Engine\n----------------------------------\n\nTo use Secret Manager with workloads running on App Engine, you must\ngrant any [required permissions](/secret-manager/docs/access-control#roles) to the\nApp Engine service.\n\nWhat's next\n-----------\n\n- Learn more about [managing access to Secret Manager resources with IAM](/secret-manager/docs/access-control).\n- Learn how to [create a secret and access a secret version](/secret-manager/docs/create-secret-quickstart)."]]