public sealed class SecretVolume : IMessage<SecretVolume>, IEquatable<SecretVolume>, IDeepCloneable<SecretVolume>, IBufferMessage, IMessage
Reference documentation and code samples for the Cloud Functions v2beta API class SecretVolume.
Configuration for a secret volume. It has the information necessary to fetch
the secret value from secret manager and make it available as files mounted
at the requested paths within the application container.
The path within the container to mount the secret volume. For example,
setting the mount_path as /etc/secrets would mount the secret value files
under the /etc/secrets directory. This directory will also be completely
shadowed and unavailable to mount any other secrets.
Recommended mount path: /etc/secrets
Project identifier (preferably project number but can also be the project
ID) of the project that contains the secret. If not set, it is
assumed that the secret is in the same project as the function.
public RepeatedField<SecretVolume.Types.SecretVersion> Versions { get; }
List of secret versions to mount for this secret. If empty, the latest
version of the secret will be made available in a file named after the
secret under the mount point.
[[["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-09-09 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eSecretVolume\u003c/code\u003e class in the Cloud Functions v2beta API allows configuration for mounting secret values from Secret Manager into application containers.\u003c/p\u003e\n"],["\u003cp\u003eIt supports specifying a \u003ccode\u003eMountPath\u003c/code\u003e within the container where the secret volume will be accessible, such as \u003ccode\u003e/etc/secrets\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eYou can define the \u003ccode\u003eProjectId\u003c/code\u003e of the secret, and if not provided, it's assumed to be in the same project as the function.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSecret\u003c/code\u003e property is used to define the name of the secret, and the \u003ccode\u003eVersions\u003c/code\u003e property determines which secret versions to make available.\u003c/p\u003e\n"],["\u003cp\u003eThis class implements multiple interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e providing advanced capabilities.\u003c/p\u003e\n"]]],[],null,["# Cloud Functions v2beta API - Class SecretVolume (1.0.0-beta07)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta07 (latest)](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.SecretVolume)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/1.0.0-beta06/Google.Cloud.Functions.V2Beta.SecretVolume) \n\n public sealed class SecretVolume : IMessage\u003cSecretVolume\u003e, IEquatable\u003cSecretVolume\u003e, IDeepCloneable\u003cSecretVolume\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Functions v2beta API class SecretVolume.\n\nConfiguration for a secret volume. It has the information necessary to fetch\nthe secret value from secret manager and make it available as files mounted\nat the requested paths within the application container. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e SecretVolume \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[SecretVolume](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.SecretVolume), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[SecretVolume](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.SecretVolume), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[SecretVolume](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.SecretVolume), [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.Functions.V2Beta](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta)\n\nAssembly\n--------\n\nGoogle.Cloud.Functions.V2Beta.dll\n\nConstructors\n------------\n\n### SecretVolume()\n\n public SecretVolume()\n\n### SecretVolume(SecretVolume)\n\n public SecretVolume(SecretVolume other)\n\nProperties\n----------\n\n### MountPath\n\n public string MountPath { get; set; }\n\nThe path within the container to mount the secret volume. For example,\nsetting the mount_path as `/etc/secrets` would mount the secret value files\nunder the `/etc/secrets` directory. This directory will also be completely\nshadowed and unavailable to mount any other secrets.\nRecommended mount path: /etc/secrets\n\n### ProjectId\n\n public string ProjectId { get; set; }\n\nProject identifier (preferably project number but can also be the project\nID) of the project that contains the secret. If not set, it is\nassumed that the secret is in the same project as the function.\n\n### Secret\n\n public string Secret { get; set; }\n\nName of the secret in secret manager (not the full resource name).\n\n### Versions\n\n public RepeatedField\u003cSecretVolume.Types.SecretVersion\u003e Versions { get; }\n\nList of secret versions to mount for this secret. If empty, the `latest`\nversion of the secret will be made available in a file named after the\nsecret under the mount point."]]