public bool AllTrafficOnLatestRevision { get; set; }
Whether 100% of traffic is routed to the latest revision.
On CreateFunction and UpdateFunction, when set to true, the revision being
deployed will serve 100% of traffic, ignoring any traffic split settings,
if any. On GetFunction, true will be returned if the latest revision is
serving 100% of traffic.
The limit on the maximum number of function instances that may coexist at a
given time.
In some cases, such as rapid traffic surges, Cloud Functions may, for a
short period of time, create more instances than the specified max
instances limit. If your function cannot tolerate this temporary behavior,
you may want to factor in a safety margin and set a lower max instances
value than your function can tolerate.
The limit on the minimum number of function instances that may coexist at a
given time.
Function instances are kept in idle state for a short period after they
finished executing the request to reduce cold start time for subsequent
requests. Setting a minimum instance count will ensure that the given
number of instances are kept running in idle state always. This can help
with cold start times when jump in incoming request count occurs after the
idle instance would have been stopped in the default case.
public ServiceConfig.Types.SecurityLevel SecurityLevel { get; set; }
Security level configure whether the function only accepts https.
This configuration is only applicable to 1st Gen functions with Http
trigger. By default https is optional for 1st Gen functions; 2nd Gen
functions are https ONLY.
The function execution timeout. Execution is considered failed and
can be terminated if the function is not completed at the end of the
timeout period. Defaults to 60 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-09 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eServiceConfig\u003c/code\u003e class in the Cloud Functions v2beta API describes the service being deployed, specifically for Cloud Run (fully managed) environments.\u003c/p\u003e\n"],["\u003cp\u003eIt supports configuration options like CPU and memory allocation, with the \u003ccode\u003eAvailableCpu\u003c/code\u003e and \u003ccode\u003eAvailableMemory\u003c/code\u003e properties, respectively.\u003c/p\u003e\n"],["\u003cp\u003eThe class allows setting environment variables (\u003ccode\u003eEnvironmentVariables\u003c/code\u003e) and secret management through \u003ccode\u003eSecretEnvironmentVariables\u003c/code\u003e and \u003ccode\u003eSecretVolumes\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTraffic routing is configurable, as users can specify if 100% of traffic should be directed to the latest revision using the \u003ccode\u003eAllTrafficOnLatestRevision\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eIt enables setting limits for function instances through \u003ccode\u003eMaxInstanceCount\u003c/code\u003e and \u003ccode\u003eMinInstanceCount\u003c/code\u003e properties, and configuring request concurrency using \u003ccode\u003eMaxInstanceRequestConcurrency\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Cloud Functions v2beta API - Class ServiceConfig (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.ServiceConfig)\n- [1.0.0-beta06](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/1.0.0-beta06/Google.Cloud.Functions.V2Beta.ServiceConfig) \n\n public sealed class ServiceConfig : IMessage\u003cServiceConfig\u003e, IEquatable\u003cServiceConfig\u003e, IDeepCloneable\u003cServiceConfig\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Functions v2beta API class ServiceConfig.\n\nDescribes the Service being deployed.\nCurrently Supported : Cloud Run (fully managed). \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ServiceConfig \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[ServiceConfig](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.ServiceConfig), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[ServiceConfig](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.ServiceConfig), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[ServiceConfig](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.ServiceConfig), [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### ServiceConfig()\n\n public ServiceConfig()\n\n### ServiceConfig(ServiceConfig)\n\n public ServiceConfig(ServiceConfig other)\n\nProperties\n----------\n\n### AllTrafficOnLatestRevision\n\n public bool AllTrafficOnLatestRevision { get; set; }\n\nWhether 100% of traffic is routed to the latest revision.\nOn CreateFunction and UpdateFunction, when set to true, the revision being\ndeployed will serve 100% of traffic, ignoring any traffic split settings,\nif any. On GetFunction, true will be returned if the latest revision is\nserving 100% of traffic.\n\n### AvailableCpu\n\n public string AvailableCpu { get; set; }\n\nThe number of CPUs used in a single container instance.\nDefault value is calculated from available memory.\nSupports the same values as Cloud Run, see\n\u003chttps://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements\u003e\nExample: \"1\" indicates 1 vCPU\n\n### AvailableMemory\n\n public string AvailableMemory { get; set; }\n\nThe amount of memory available for a function.\nDefaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is\nsupplied the value is interpreted as bytes.\nSee\n\u003chttps://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go\u003e\na full description.\n\n### BinaryAuthorizationPolicy\n\n public string BinaryAuthorizationPolicy { get; set; }\n\nOptional. The binary authorization policy to be checked when deploying the\nCloud Run service.\n\n### EnvironmentVariables\n\n public MapField\u003cstring, string\u003e EnvironmentVariables { get; }\n\nEnvironment variables that shall be available during function execution.\n\n### IngressSettings\n\n public ServiceConfig.Types.IngressSettings IngressSettings { get; set; }\n\nThe ingress settings for the function, controlling what traffic can reach\nit.\n\n### MaxInstanceCount\n\n public int MaxInstanceCount { get; set; }\n\nThe limit on the maximum number of function instances that may coexist at a\ngiven time.\n\nIn some cases, such as rapid traffic surges, Cloud Functions may, for a\nshort period of time, create more instances than the specified max\ninstances limit. If your function cannot tolerate this temporary behavior,\nyou may want to factor in a safety margin and set a lower max instances\nvalue than your function can tolerate.\n\nSee the [Max\nInstances](https://cloud.google.com/functions/docs/max-instances) Guide for\nmore details.\n\n### MaxInstanceRequestConcurrency\n\n public int MaxInstanceRequestConcurrency { get; set; }\n\nSets the maximum number of concurrent requests that each instance\ncan receive. Defaults to 1.\n\n### MinInstanceCount\n\n public int MinInstanceCount { get; set; }\n\nThe limit on the minimum number of function instances that may coexist at a\ngiven time.\n\nFunction instances are kept in idle state for a short period after they\nfinished executing the request to reduce cold start time for subsequent\nrequests. Setting a minimum instance count will ensure that the given\nnumber of instances are kept running in idle state always. This can help\nwith cold start times when jump in incoming request count occurs after the\nidle instance would have been stopped in the default case.\n\n### Revision\n\n public string Revision { get; set; }\n\nOutput only. The name of service revision.\n\n### SecretEnvironmentVariables\n\n public RepeatedField\u003cSecretEnvVar\u003e SecretEnvironmentVariables { get; }\n\nSecret environment variables configuration.\n\n### SecretVolumes\n\n public RepeatedField\u003cSecretVolume\u003e SecretVolumes { get; }\n\nSecret volumes configuration.\n\n### SecurityLevel\n\n public ServiceConfig.Types.SecurityLevel SecurityLevel { get; set; }\n\nSecurity level configure whether the function only accepts https.\nThis configuration is only applicable to 1st Gen functions with Http\ntrigger. By default https is optional for 1st Gen functions; 2nd Gen\nfunctions are https ONLY.\n\n### Service\n\n public string Service { get; set; }\n\nOutput only. Name of the service associated with a Function.\nThe format of this field is\n`projects/{project}/locations/{region}/services/{service}`\n\n### ServiceAccountEmail\n\n public string ServiceAccountEmail { get; set; }\n\nThe email of the service's service account. If empty, defaults to\n`{project_number}-compute@developer.gserviceaccount.com`.\n\n### ServiceAsServiceName\n\n public ServiceName ServiceAsServiceName { get; set; }\n\n[ServiceName](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.ServiceName)-typed view over the [Service](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.ServiceConfig#Google_Cloud_Functions_V2Beta_ServiceConfig_Service) resource name property.\n\n### TimeoutSeconds\n\n public int TimeoutSeconds { get; set; }\n\nThe function execution timeout. Execution is considered failed and\ncan be terminated if the function is not completed at the end of the\ntimeout period. Defaults to 60 seconds.\n\n### Uri\n\n public string Uri { get; set; }\n\nOutput only. URI of the Service deployed.\n\n### VpcConnector\n\n public string VpcConnector { get; set; }\n\nThe Serverless VPC Access connector that this cloud function can connect\nto. The format of this field is `projects/*/locations/*/connectors/*`.\n\n### VpcConnectorAsConnectorName\n\n public ConnectorName VpcConnectorAsConnectorName { get; set; }\n\n[ConnectorName](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.ConnectorName)-typed view over the [VpcConnector](/dotnet/docs/reference/Google.Cloud.Functions.V2Beta/latest/Google.Cloud.Functions.V2Beta.ServiceConfig#Google_Cloud_Functions_V2Beta_ServiceConfig_VpcConnector) resource name property.\n\n### VpcConnectorEgressSettings\n\n public ServiceConfig.Types.VpcConnectorEgressSettings VpcConnectorEgressSettings { get; set; }\n\nThe egress settings for the connector, controlling what traffic is diverted\nthrough it."]]