public MapField<string, ByteString> SecretEnv { get; }
Map of environment variable name to its encrypted value.
Secret environment variables must be unique across all of a build's
secrets, and must be used by at least one build step. Values can be at most
64 KB in size. There can be at most 100 secret values across all of a
build's secrets.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-19 UTC."],[[["\u003cp\u003eThe latest version of the \u003ccode\u003eSecret\u003c/code\u003e class within the Cloud Build v1 API is 2.15.0, with the page containing documentation for multiple versions ranging from 1.0.0 to 2.15.0.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSecret\u003c/code\u003e class provides a way to manage encrypted secret environment variables for use in Cloud Build, paired with a Cloud KMS key for decryption.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSecret\u003c/code\u003e class includes properties \u003ccode\u003eKmsKeyName\u003c/code\u003e for specifying the Cloud KMS key and \u003ccode\u003eSecretEnv\u003c/code\u003e for storing the encrypted environment variables, which must be unique and used by at least one build step, with size and quantity constraints.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSecret\u003c/code\u003e class implements multiple interfaces including IMessage, IEquatable, IDeepCloneable, and IBufferMessage, indicating its capabilities for message handling, comparison, deep cloning, and buffer management within the .NET environment.\u003c/p\u003e\n"]]],[],null,["# Cloud Build v1 API - Class Secret (2.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.16.0 (latest)](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.Secret)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.15.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.14.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.13.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.12.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.11.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.10.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.9.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.8.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.7.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.6.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.5.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.4.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.3.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.2.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.1.0/Google.Cloud.CloudBuild.V1.Secret)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/2.0.0/Google.Cloud.CloudBuild.V1.Secret)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.4.0/Google.Cloud.CloudBuild.V1.Secret)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.3.0/Google.Cloud.CloudBuild.V1.Secret)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.2.0/Google.Cloud.CloudBuild.V1.Secret)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.1.0/Google.Cloud.CloudBuild.V1.Secret)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/1.0.0/Google.Cloud.CloudBuild.V1.Secret) \n\n public sealed class Secret : IMessage\u003cSecret\u003e, IEquatable\u003cSecret\u003e, IDeepCloneable\u003cSecret\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Build v1 API class Secret.\n\nPairs a set of secret environment variables containing encrypted\nvalues with the Cloud KMS key to use to decrypt the value.\nNote: Use `kmsKeyName` with `available_secrets` instead of using\n`kmsKeyName` with `secret`. For instructions see:\n\u003chttps://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials\u003e. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Secret \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Secret](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.Secret), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Secret](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.Secret), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Secret](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1.Secret), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.CloudBuild.V1](/dotnet/docs/reference/Google.Cloud.CloudBuild.V1/latest/Google.Cloud.CloudBuild.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.CloudBuild.V1.dll\n\nConstructors\n------------\n\n### Secret()\n\n public Secret()\n\n### Secret(Secret)\n\n public Secret(Secret other)\n\nProperties\n----------\n\n### KmsKeyName\n\n public string KmsKeyName { get; set; }\n\nCloud KMS key name to use to decrypt these envs.\n\n### SecretEnv\n\n public MapField\u003cstring, ByteString\u003e SecretEnv { get; }\n\nMap of environment variable name to its encrypted value.\n\nSecret environment variables must be unique across all of a build's\nsecrets, and must be used by at least one build step. Values can be at most\n64 KB in size. There can be at most 100 secret values across all of a\nbuild's secrets."]]