docs/en/framework/infrastructure/blob-storing/google.md
//[doc-seo]
{
"Description": "Learn how to configure BLOB storage in Google Cloud with ABP Framework, enhancing your project's cloud capabilities effortlessly."
}
BLOB Storing Google Provider can store BLOBs in Google Cloud Storage.
Read the BLOB Storing document to understand how to use the BLOB storing system. This document only covers how to configure containers to use a Google Cloud Storage as the storage provider.
Use the ABP CLI to add Volo.Abp.BlobStoring.Google NuGet package to your project:
.csproj file you want to add the Volo.Abp.BlobStoring.Google package.abp add-package Volo.Abp.BlobStoring.Google command.If you want to do it manually, install the Volo.Abp.BlobStoring.Google NuGet package to your project and add [DependsOn(typeof(AbpBlobStoringGoogleModule))] to the ABP module class inside your project.
Configuration is done in the ConfigureServices method of your module class, as explained in the BLOB Storing document.
Example: Configure to use the Google storage provider by default
Configure<AbpBlobStoringOptions>(options =>
{
options.Containers.ConfigureDefault(container =>
{
container.UseGoogle(google =>
{
google.ClientEmail = "your google client email";
google.ProjectId = "your google project id";
google.PrivateKey = "your google private key";
google.Scopes = "your google scopes";
google.ContainerName = "your google container name";
google.CreateContainerIfNotExists = true;
//google.UseApplicationDefaultCredentials = true; // If you want to use application default credentials
});
});
});
See the BLOB Storing document to learn how to configure this provider for a specific container.
true, it uses the application default credentials(ADC). Default value is false. Please refer to Google documentation: https://cloud.google.com/docs/authentication/provide-credentials-adcBlobContainerName attribute (see the BLOB storing document). Please note that Google has some rules for naming containers. A container name must be a valid DNS name, conforming to the following naming rules:
false, If a container does not exist in Google, GoogleBlobProvider will try to create it.Google Blob Provider organizes BLOB name and implements some conventions. The full name of a BLOB is determined by the following rules by default:
host string if current tenant is null (or multi-tenancy is disabled for the container - see the BLOB Storing document to learn how to disable multi-tenancy for a container).tenants/<tenant-id> string if current tenant is not null.GoogleBlobProvider is the main service that implements the Google BLOB storage provider, if you want to override/replace it via dependency injection (don't replace IBlobProvider interface, but replace GoogleBlobProvider class).IGoogleBlobNameCalculator is used to calculate the full BLOB name (that is explained above). It is implemented by the DefaultGoogleBlobNameCalculator by default.