Configurar o ADC para um local ou outro provedor de nuvem
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Se o aplicativo estiver sendo executado fora de Google Cloud, será necessário
fornecer credenciais reconhecidas por Google Cloud para
usar os serviços Google Cloud .
Federação de identidade da carga de trabalho
A maneira mais comum de autenticar com Google Cloud usando credenciais de
um IdP externo é usar a federação de identidade da carga de trabalho.
Crie um arquivo de configuração de credenciais e defina a
variável de ambiente GOOGLE_APPLICATION_CREDENTIALS para apontar para ele. Essa abordagem é mais segura do que criar uma chave de conta de serviço.
Se não for possível configurar a federação de identidade da carga de trabalho,
crie uma conta de serviço, conceda a ela os papéis do IAM
necessários ao aplicativo e crie uma chave para a conta de serviço.
Para criar uma chave de conta de serviço e disponibilizá-la para o ADC, faça o seguinte:
Crie uma conta de serviço com os papéis de que seu aplicativo precisa e uma chave
para essa conta de serviço. Para fazer isso, siga as instruções em
Como criar uma chave de conta de serviço.
Set the environment variable GOOGLE_APPLICATION_CREDENTIALS
to the path of the JSON file that contains your credentials.
This variable applies only to your current shell session, so if you open
a new session, set the variable again.
Example: Linux or macOS
exportGOOGLE_APPLICATION_CREDENTIALS="KEY_PATH"
Replace KEY_PATH with the path of the JSON file that contains your credentials.
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 2025-04-21 UTC."],[[["If running applications outside of Google Cloud, you need to provide credentials recognized by Google Cloud to access its services."],["Workload Identity Federation is the recommended method for authenticating with Google Cloud using external credentials, as it is more secure than service account keys."],["If Workload Identity Federation is not feasible, service account keys can be used, but they pose a security risk and should be avoided if possible."],["To use service account keys, create a service account with the necessary roles, generate a key, and set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable to the key file's path."],["The `GOOGLE_APPLICATION_CREDENTIALS` environment variable directs Application Default Credentials (ADC) to the specified credential location, and it takes precedence over other credential locations."]]],[]]