-
Create a project in the Google Cloud Platform Console. If you haven't already created a project, create one now. Projects enable you to manage all Google Cloud Platform resources for your app, including deployment, access control, billing, and services.
- Open the Cloud Platform Console.
- In the drop-down menu at the top, select Create a project.
- Click Show advanced options. Under App Engine location, select a United States location.
- Give your project a name.
- Make a note of the project ID, which might be different from the project name. The project ID is used in commands and in configurations.
-
Enable billing for your project. If you haven't already enabled billing for your project, enable billing now. Enabling billing allows the application to consume billable resources such as running instances and storing data.
-
Install the Google Cloud SDK. If you haven't already installed the Google Cloud SDK, install and initialize the Google Cloud SDK now. The SDK contains tools and libraries that enable you to create and manage resources on Google Cloud Platform.
-
Enable APIs for your project. Click here to visit Cloud Platform Console and enable the APIs.
-
Download or clone this repo with
git clone https://github.com/GoogleCloudPlatform/getting-started-dotnet
-
Set the environment variables:
- GoogleCloudSamples:ProjectId = your project id displayed on the Google Developers Console.
- GoogleCloudSamples:BucketName = the name of the Google Cloud Storage bucket you created.
- GoogleCloudSamples:ApplicationName = the name for your application.
- GoogleCloudSamples:AuthClientId = the service account id of the service account you created.
- GoogleCloudSamples:AuthClientSecret = the local path to the JSON file containing the service account's private key.
- GoogleCloudSamples:ConnectionStringCloudSql= the connection string for the Cloud SQL database you created, in the format of "Server=1.2.3.4;Database=bookshelf;Uid=dotnetapp;Pwd=password".
- GoogleCloudSamples:ConnectionStringSqlServer= the connection string for the SQL Server database you created, in the format of "Data Source=ServerName;Initial Catalog=DatabaseName;Integrated Security=False;User Id=userid;Password=password".
- Add the following tools to your path:
- MSBuild
- MSTest
- Nuget
-
Run the test script:
C:\...\getting-started-dotnet\aspnet> powershell ..\BuildAndRunTests.ps1