The function environment the generated upload url will be used for.
The upload url for 2nd Gen functions can also be used for 1st gen
functions, but not vice versa. If not specified, 2nd generation-style
upload URLs are generated.
[Preview] Resource name of a KMS crypto key (managed by the user) used to
encrypt/decrypt function source code objects in intermediate Cloud Storage
buckets. When you generate an upload url and upload your source code, it
gets copied to an intermediate Cloud Storage bucket. The source code is
then copied to a versioned directory in the sources bucket in the consumer
project during the function deployment.
It must match the pattern
projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}.
The Google Cloud Functions service account
(service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be
granted the role 'Cloud KMS CryptoKey Encrypter/Decrypter
(roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the
Key/KeyRing/Project/Organization (least access preferred).
[[["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\u003eThis webpage provides documentation for the \u003ccode\u003eGenerateUploadUrlRequest\u003c/code\u003e class within the Google Cloud Functions v2 API, specifically for .NET developers.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eGenerateUploadUrlRequest\u003c/code\u003e class is used to request the generation of a signed URL for uploading source code to Google Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eThe class implements multiple interfaces such as \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, and inherits from \u003ccode\u003eobject\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eKey properties of \u003ccode\u003eGenerateUploadUrlRequest\u003c/code\u003e include \u003ccode\u003eEnvironment\u003c/code\u003e, \u003ccode\u003eKmsKeyName\u003c/code\u003e, and \u003ccode\u003eParent\u003c/code\u003e, which specify the function environment, encryption key, and the project/location for the URL.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this resource available is 1.7.0, with prior versions down to 1.0.0 also available to view.\u003c/p\u003e\n"]]],[],null,["# Cloud Functions v2 API - Class GenerateUploadUrlRequest (1.7.0)\n\nVersion latestkeyboard_arrow_down\n\n- [1.7.0 (latest)](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.GenerateUploadUrlRequest)\n- [1.6.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.6.0/Google.Cloud.Functions.V2.GenerateUploadUrlRequest)\n- [1.5.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.5.0/Google.Cloud.Functions.V2.GenerateUploadUrlRequest)\n- [1.4.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.4.0/Google.Cloud.Functions.V2.GenerateUploadUrlRequest)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.3.0/Google.Cloud.Functions.V2.GenerateUploadUrlRequest)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.2.0/Google.Cloud.Functions.V2.GenerateUploadUrlRequest)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.1.0/Google.Cloud.Functions.V2.GenerateUploadUrlRequest)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Functions.V2/1.0.0/Google.Cloud.Functions.V2.GenerateUploadUrlRequest) \n\n public sealed class GenerateUploadUrlRequest : IMessage\u003cGenerateUploadUrlRequest\u003e, IEquatable\u003cGenerateUploadUrlRequest\u003e, IDeepCloneable\u003cGenerateUploadUrlRequest\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Cloud Functions v2 API class GenerateUploadUrlRequest.\n\nRequest of `GenerateSourceUploadUrl` method. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e GenerateUploadUrlRequest \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[GenerateUploadUrlRequest](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.GenerateUploadUrlRequest), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[GenerateUploadUrlRequest](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.GenerateUploadUrlRequest), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[GenerateUploadUrlRequest](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.GenerateUploadUrlRequest), [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.V2](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2)\n\nAssembly\n--------\n\nGoogle.Cloud.Functions.V2.dll\n\nConstructors\n------------\n\n### GenerateUploadUrlRequest()\n\n public GenerateUploadUrlRequest()\n\n### GenerateUploadUrlRequest(GenerateUploadUrlRequest)\n\n public GenerateUploadUrlRequest(GenerateUploadUrlRequest other)\n\nProperties\n----------\n\n### Environment\n\n public Environment Environment { get; set; }\n\nThe function environment the generated upload url will be used for.\nThe upload url for 2nd Gen functions can also be used for 1st gen\nfunctions, but not vice versa. If not specified, 2nd generation-style\nupload URLs are generated.\n\n### KmsKeyName\n\n public string KmsKeyName { get; set; }\n\n\\[Preview\\] Resource name of a KMS crypto key (managed by the user) used to\nencrypt/decrypt function source code objects in intermediate Cloud Storage\nbuckets. When you generate an upload url and upload your source code, it\ngets copied to an intermediate Cloud Storage bucket. The source code is\nthen copied to a versioned directory in the sources bucket in the consumer\nproject during the function deployment.\n\nIt must match the pattern\n`projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.\n\nThe Google Cloud Functions service account\n(service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) must be\ngranted the role 'Cloud KMS CryptoKey Encrypter/Decrypter\n(roles/cloudkms.cryptoKeyEncrypterDecrypter)' on the\nKey/KeyRing/Project/Organization (least access preferred).\n\n### KmsKeyNameAsCryptoKeyName\n\n public CryptoKeyName KmsKeyNameAsCryptoKeyName { get; set; }\n\n[CryptoKeyName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.CryptoKeyName)-typed view over the [KmsKeyName](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.GenerateUploadUrlRequest#Google_Cloud_Functions_V2_GenerateUploadUrlRequest_KmsKeyName) resource name property.\n\n### Parent\n\n public string Parent { get; set; }\n\nRequired. The project and location in which the Google Cloud Storage signed\nURL should be generated, specified in the format `projects/*/locations/*`.\n\n### ParentAsLocationName\n\n public LocationName ParentAsLocationName { get; set; }\n\n[LocationName](https://cloud.google.com/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.ResourceNames.LocationName.html)-typed view over the [Parent](/dotnet/docs/reference/Google.Cloud.Functions.V2/latest/Google.Cloud.Functions.V2.GenerateUploadUrlRequest#Google_Cloud_Functions_V2_GenerateUploadUrlRequest_Parent) resource name property."]]