Optional. Email address of the IAM service account associated with the Task
of a Job. The service account represents the identity of the running task,
and determines what permissions the task has. If not provided, the task
will use the project's default service account.
Optional. Max allowed time duration the Task may be active before the
system will actively try to mark it failed and kill associated containers.
This applies per attempt of a task, meaning each retry can run for the full
timeout. Defaults to 600 seconds.
[[["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-04 UTC."],[[["\u003cp\u003eThis document provides reference documentation for the \u003ccode\u003eTaskTemplate\u003c/code\u003e class within the Google Cloud Run Admin v2 API for .NET.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTaskTemplate\u003c/code\u003e class describes the configuration of a task when created from a template, including properties such as containers, encryption keys, and execution environment.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of \u003ccode\u003eTaskTemplate\u003c/code\u003e is 2.13.0, with previous versions back to 1.0.0-beta02 also documented and available.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTaskTemplate\u003c/code\u003e inherits from \u003ccode\u003eobject\u003c/code\u003e and 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.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of the \u003ccode\u003eTaskTemplate\u003c/code\u003e include \u003ccode\u003eContainers\u003c/code\u003e which defines the unit of execution, \u003ccode\u003eEncryptionKey\u003c/code\u003e for customer-managed encryption, \u003ccode\u003eMaxRetries\u003c/code\u003e for the number of allowed retries, \u003ccode\u003eTimeout\u003c/code\u003e for the maximum allowed task duration and \u003ccode\u003eVolumes\u003c/code\u003e to provide a list of volumes available for the container.\u003c/p\u003e\n"]]],[],null,["# Cloud Run Admin v2 API - Class TaskTemplate (2.16.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.16.0 (latest)](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.TaskTemplate)\n- [2.15.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.15.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.14.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.14.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.13.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.13.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.12.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.11.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.10.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.9.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.8.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.7.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.6.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.5.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.4.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.3.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.2.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.1.0/Google.Cloud.Run.V2.TaskTemplate)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Run.V2/2.0.0/Google.Cloud.Run.V2.TaskTemplate)\n- [1.0.0-beta02](/dotnet/docs/reference/Google.Cloud.Run.V2/1.0.0-beta02/Google.Cloud.Run.V2.TaskTemplate) \n\n public sealed class TaskTemplate : IMessage\u003cTaskTemplate\u003e, IEquatable\u003cTaskTemplate\u003e, IDeepCloneable\u003cTaskTemplate\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Run Admin v2 API class TaskTemplate.\n\nTaskTemplate describes the data a task should have when created\nfrom a template. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e TaskTemplate \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TaskTemplate](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.TaskTemplate), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TaskTemplate](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.TaskTemplate), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TaskTemplate](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.TaskTemplate), [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.Run.V2](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Run.V2.dll\n\nConstructors\n------------\n\n### TaskTemplate()\n\n public TaskTemplate()\n\n### TaskTemplate(TaskTemplate)\n\n public TaskTemplate(TaskTemplate other)\n\nProperties\n----------\n\n### Containers\n\n public RepeatedField\u003cContainer\u003e Containers { get; }\n\nHolds the single container that defines the unit of execution for this\ntask.\n\n### EncryptionKey\n\n public string EncryptionKey { get; set; }\n\nA reference to a customer managed encryption key (CMEK) to use to encrypt\nthis container image. For more information, go to\n\u003chttps://cloud.google.com/run/docs/securing/using-cmek\u003e\n\n### EncryptionKeyAsCryptoKeyName\n\n public CryptoKeyName EncryptionKeyAsCryptoKeyName { get; set; }\n\n[CryptoKeyName](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.CryptoKeyName)-typed view over the [EncryptionKey](/dotnet/docs/reference/Google.Cloud.Run.V2/latest/Google.Cloud.Run.V2.TaskTemplate#Google_Cloud_Run_V2_TaskTemplate_EncryptionKey) resource name property.\n\n### ExecutionEnvironment\n\n public ExecutionEnvironment ExecutionEnvironment { get; set; }\n\nOptional. The execution environment being used to host this Task.\n\n### GpuZonalRedundancyDisabled\n\n public bool GpuZonalRedundancyDisabled { get; set; }\n\nOptional. True if GPU zonal redundancy is disabled on this task template.\n\n### HasGpuZonalRedundancyDisabled\n\n public bool HasGpuZonalRedundancyDisabled { get; }\n\nGets whether the \"gpu_zonal_redundancy_disabled\" field is set\n\n### HasMaxRetries\n\n public bool HasMaxRetries { get; }\n\nGets whether the \"max_retries\" field is set\n\n### MaxRetries\n\n public int MaxRetries { get; set; }\n\nNumber of retries allowed per Task, before marking this Task failed.\nDefaults to 3.\n\n### NodeSelector\n\n public NodeSelector NodeSelector { get; set; }\n\nOptional. The node selector for the task template.\n\n### RetriesCase\n\n public TaskTemplate.RetriesOneofCase RetriesCase { get; }\n\n### ServiceAccount\n\n public string ServiceAccount { get; set; }\n\nOptional. Email address of the IAM service account associated with the Task\nof a Job. The service account represents the identity of the running task,\nand determines what permissions the task has. If not provided, the task\nwill use the project's default service account.\n\n### Timeout\n\n public Duration Timeout { get; set; }\n\nOptional. Max allowed time duration the Task may be active before the\nsystem will actively try to mark it failed and kill associated containers.\nThis applies per attempt of a task, meaning each retry can run for the full\ntimeout. Defaults to 600 seconds.\n\n### Volumes\n\n public RepeatedField\u003cVolume\u003e Volumes { get; }\n\nOptional. A list of Volumes to make available to containers.\n\n### VpcAccess\n\n public VpcAccess VpcAccess { get; set; }\n\nOptional. VPC Access configuration to use for this Task. For more\ninformation, visit\n\u003chttps://cloud.google.com/run/docs/configuring/connecting-vpc\u003e."]]