Install a Development Environment
Create a Google Cloud Project
Create a Google Cloud Project for running your applications. Google Cloud Platform projects form the basis for creating, enabling, and using all Cloud Platform services.
During local development, your .NET application must authenticate itself in order to interact with Google Cloud Platform APIs. The instructions below describe how to create a Service Account key for authenticating your application. Applications can use this method to authenticate locally and when deployed to Google Cloud Platform. Read more about authentication, including how authentication is handled once your application is deployed.
Create a Service Account key for authentication
- Visit the APIs & services dashboard
and click Credentials.
- Click Create credentials and choose Service Account key.
- Under Service account, choose Compute Engine default service account, and leave JSON selected under Key Type. Click Create. A .json file will be downloaded to your computer.
Set the environment variable
GOOGLE_APPLICATION_CREDENTIALSto the path of the JSON key that was downloaded. In powershell, the commands are:
For this powershell session.
$env:GOOGLE_APPLICATION_CREDENTIALS = "$env:USERPROFILE\Downloads\your-project-id-dea9fa230eae3.json"
For all processes created after this command.
[Environment]::SetEnvironmentVariable("GOOGLE_APPLICATION_CREDENTIALS", "$env:USERPROFILE\Downloads\your-project-id-dea9fa230eae3.json", "User")
(Optional) Install .NET Tools and SDKs
Even though you can create and manage Google Cloud resources via your web browser using the Cloud Console, if you'd prefer to manage your Google Cloud resources from within Visual Studio or from the command-line, you should consider installing the following tools:
The Cloud SDK is a command-line interface for Google Cloud Platform products and services.
Cloud Tools for Visual Studio enables development in Visual Studio on Google Cloud Platform.
Google Cloud Tools for PowerShell is a set of cmdlets for Windows PowerShell that lets you manage Google Cloud Platform resources.
- Clone the .NET samples repository from GitHub.