I am interested in changing Google Cloud Storage bucket region when creating bucket in C# application programmatically. Here is the method:
StorageClient storageClient = StorageClient.Create();
storageClient.CreateBucket(projectId, bucketName);
But it seems there is no way to change default region. It should be a very simple thing to do, but I can not find any information on it.
From the official Google Cloud Storage sample :
private void CreateRegionalBucket(string location, string bucketName)
{
var storage = StorageClient.Create();
Bucket bucket = new Bucket { Location = location, Name = bucketName };
storage.CreateBucket(s_projectId, bucket);
Console.WriteLine($"Created {bucketName}.");
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.