BigQuery with .NET Core

Here is a sample respository ready to be injected to a ASP.NET Core application.

   public class SelfViewRepository : ISelfViewRepository
        private readonly string _projectId;
        private readonly GoogleCredential _gcpCredential;

        public SelfViewRepository(string projectId, string credentialFile)
            _projectId = projectId;
            _gcpCredential = GoogleCredential.FromFile(credentialFile);

        public async Task<BigQueryResults> GetData(string query)
            BigQueryClient client = BigQueryClient.Create(_projectId, _gcpCredential);

            BigQueryJob job = client.CreateQueryJob(
                sql: query,
                parameters: null,
                // options: new QueryOptions {UseQueryCache = false});
                options: new QueryOptions { });
            var data = await job.GetQueryResultsAsync();
            // Wait for the job to complete.
            // Display the results
            return data;

#googlecloud #bigquery #aspnetcore


Google Cloud Build Trigger: ASP.NET Core and Angular

# run npm install for Angular
- name: ''
  args: ['install']
  dir: 'MyProject.Web/ClientApp'
# build Angular for production
- name: ''
  args: ['run', 'build','--','--prod']
  dir: 'MyProject.Web/ClientApp'
# publish core solution  
- name: microsoft/dotnet:2.2-sdk
  args: ['dotnet', 'publish','-c','Release']
# deploy the webapi to the AppEngine
- name:
  args: ['app', 'deploy', './MyProject.Web/bin/Release/netcoreapp2.2/publish/app.yaml','--version','staging']
timeout: 660s

Other examples:

#GoogleCloud #gcp #BuildTrigger