本教學課程說明如何為 .NET 與 .NET Framework 應用程式的開發環境準備本機電腦,這些應用程式可在 Google Cloud 上執行及呼叫 Google Cloud API。
安裝開發環境
如要執行 .NET 教學課程及本說明文件中的範例應用程式,建議的開發環境為 Visual Studio 或 Visual Studio Code。
建立 Google Cloud 專案
建立 Google Cloud 專案以執行應用程式。 Google Cloud 專案是建立、啟用及使用所有 Google Cloud 服務的基礎。
設定驗證方法
您的 .NET 應用程式必須通過驗證,才能使用 Google Cloud API。您可以使用應用程式預設憑證 (ADC),為本機開發或正式環境提供憑證。
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
詳情請參閱「進行驗證以使用用戶端程式庫」一文。如需驗證的一般資訊,請參閱「Google 的驗證方式」。
(選用) 安裝 .NET 工具與 SDK
即使您可以使用網路瀏覽器,透過Google Cloud 主控台建立及管理 Google Cloud 資源,如果您希望從 Visual Studio 或指令列管理 Google Cloud 資源,可以考慮安裝下列工具:
Google Cloud CLI: gcloud CLI 是 Google Cloud產品和服務的指令列介面。
Tools for Visual Studio:Tools for Visual Studio 可讓您在 Visual Studio 中開發 Google Cloud應用程式。