0

I am running Visual Studio for Mac and I am truing to deploy my ASP.NET Core App to my Google App Engine project. I followed the steps described in this official guide but I got stuck in the "Install Cloud Tools for Visual Studio" step as there's no extension for Visual Studio Mac version.

I also came across the Cloud SDK for Mac and now I am confused which way to go. What's the relationship between these two guides and what's the right way of deploying a VS ASP project to App Engine on a Mac?

EDIT

app.yaml file contains:

runtime: aspnetcore env: flex

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97
Jay
  • 4,873
  • 7
  • 72
  • 137
  • FWIW, that official guide is a guide for deploying on Compute Engine, not on App Engine... – Dan Cornilescu Aug 16 '17 at 04:08
  • A bit confused here. Which one do I use to deploy my ASP.NET Core App project? I haven't used GAE before @DanCornilescu – Jay Aug 16 '17 at 04:10
  • Looks like GCE. But the guide also mentions in "Before you begin" at #3 that you need the cloud SDK installed, so it's not an "or". I suspect VS (via those cloud tools) may be using the cloud SDK under the hood to do the actual deployment. Can't really add more, I'm null at most MS stuff. – Dan Cornilescu Aug 16 '17 at 04:18
  • Okay noted. Thanks @DanCornilescu – Jay Aug 16 '17 at 04:35

3 Answers3

2

Steps to deploy to Google App Engine:

  1. Create a new ASP .Net project in Visual Studio
  2. Build your project.
  3. Install Google Cloud SDK: https://cloud.google.com/sdk/.
  4. Run the following commands via terminal while in the same directory as your VS solution file: gcloud app create dotnet restore dotnet publish -c Debug
  5. Create an app.yaml file as follows and place it in the “publish” directory.

    The contents of the app.yaml file are:

    runtime: aspnetcore env: flex

    The path to the publish directory will be as follows: ".../my_vs_project/bin/Debug/netcoreapp2.0/publish"

  6. Run the following command via terminal while in the same directory as app.yaml file:

    gcloud app deploy

1

Well, the SDK is a lower level tool to use and hence more cumbersome. Basically what "Cloud Tools for Visual Studio" does is hiding the complexities of using SDK. Since there is no GCP extention for VS Mac looks like that's the only choice that you have so you need to do SDK commands like " gcloud app create" and "gcloud app deploy" to deploy your project to GCP. I hope this is helpful.

mohi
  • 86
  • 1
  • 4
  • What should the app.yaml file contain? I got an error from the sdk tools saying 'Your application does not satisfy all of the requirements for a runtime of type [aspnetcore]'. I updated the answer with my app.yaml file – Jay Aug 16 '17 at 04:34
  • The `app.yaml` file is a GAE thing :) Again - you want GCE according to that guide... – Dan Cornilescu Aug 16 '17 at 04:37
  • Unless you were actually looking at [Google App Engine .NET Flexible Environment Documentation](https://cloud.google.com/appengine/docs/flexible/dotnet/), which is a different beast. – Dan Cornilescu Aug 16 '17 at 04:42
  • Yes I was referring to that now. Wow which way do I go haha. There's no clear documentation for this :/ @DanCornilescu – Jay Aug 16 '17 at 04:43
  • Here is the document:https://cloud.google.com/appengine/docs/flexible/dotnet/configuring-your-app-with-app-yaml – mohi Aug 16 '17 at 04:47
  • @mohi Can you show me a sample app.yaml. It gives me the same error that my app.yaml is incomplete and lacks important information – Jay Aug 16 '17 at 06:13
0

Note: the comment on another answer indicates that the confusion comes from also looking at the Google App Engine .NET Flexible Environment Documentation.

In general GAE is higher level cloud offering which can take care of some of the maintenance activities a plain, general-purpose VM infra like GCE would require (for example scalability), so you can focus more on your app itself instead.

But the choice of using GAE or GCE is really yours - it depends on how you want to build and use your app. And maybe on how well these are supported/integrated with your tools of choice (VS in your case).

Dan Cornilescu
  • 39,470
  • 12
  • 57
  • 97