ActiveReports 18 .NET Edition
DevOps / Deployment / Deploy Applications to Cloud Services / Google Cloud / Deploy on Google Cloud using a Windows Environment
In This Topic
    Deploy on Google Cloud using a Windows Environment
    In This Topic

    In this tutorial we will be deploying our JSViewer_MVC sample on Google Cloud platform using Google Compute Engine environment. The approach we are using to deploy the application is to create a VM Instance and then publish the application using Web Server (IIS).


    Setup Google Cloud

    1. Sign in or create a new account on Google Cloud Platform.
    2. Go to the Project Selector in the Google Cloud Console and create a new Project.
      Here we are naming the project as JSViewer MVC.
    3. Make sure that billing is enabled for your Cloud project. Learn how to check if billing is enabled on a project.
    4. From Console, go to the API Library and enable the 'Compute Engine API'.


    Setup Visual Studio

    1. Open Visual Studio 2019.
    2. Go to Extensions > Manage Extensions.
    3. Search online and install Google Cloud Tools for Visual Studio.
      Note: At the moment the Google Cloud Tools for Visual Studio is only supported for Visual Studio 2017 and Visual Studio 2019 which is why we will be using Visual Studio 2019.

    Setup your application

    1. Download the JSViewer_MVC sample from our WebSamples18 GitHub repository.
    2. Open the application in Visual Studio and build and run the application.
    3. Remove the Reports folder containing links the reports from the project since we will be embedding the reports in the application.
    4. Now add a new folder and name it 'Reports'.
    5. Add all the files from JSViewerReports in the Reports folder and set the Build Action as 'Embedded Resource'.
    6. Run the application.


    Create and configure a Compute Engine instance

    1. Navigate to Google Cloud Console from another browser tab or window, to https://console.cloud.google.com.
    2. In the Google Cloud console, go to the ASP.NET Framework Cloud Marketplace page.
    3. Click Launch.
    4. Leave the settings set to their default values and click Deploy.
      Wait for the Compute Engine instance to deploy. It usually takes about 5 minutes to deploy.
    5. Once finished, go to Compute Engine from the menu on the top left and select VM Instances. A new virtual machine should be added in the VM Instances list.
    6. Open the External IP in a new browser tab. You should also see the default IIS website served from the instance.
    7. Now we will create a Windows user and password to access the VM Instance in Visual Studio.
      1. Click on RDP >Set Windows password, then make note of the username.
      2. Copy the new Windows password and save it somewhere secure.
      3. Click Close.


    Deploy the application

    Now that we have configured our Compute Engine Instance, we are ready to deploy our application.

    1. In Visual Studio, go to Solution Explorer, right-click on your project and select Publish in the context menu.
      Visual Studio Solution Explorer Publish option
    2. Click on Web Server (IIS).
      Web Server (IIS)
    3. Select Web Deploy.
      Web Deploy
    4. Configure the Web Server with the following details.
      Configure Web Server (IIS) Connection
      Server The external IP address of your Compute Engine instance. This address can be found on the VM instances page in the Cloud Console.
      Site Name Default Web Site
      Note: The site name you provide here must match the name that appears in IIS Manager on your Compute Engine instance.
      Username  The username of the Windows user account you created on your Compute Engine instance.
      Password  The password of the Windows user account you created on your Compute Engine instance. 
      Destination URL http://... . The destination URL is the address where your page will be accessible after it is deployed.
    5. Click Validate Connection.
      Because the Microsoft IIS installation in your deployment uses a self-signed certificate by default, you will see a Certificate Error during the validation process. Check the box to Save this certificate for future sessions of Visual Studio, and click Accept to accept the certificate.
    6. If your configuration is valid, click Settings. Click File Publish Options, and check Remove additional files at destination. This is important for later steps when you publish new web sites to the same Compute Engine instance.
      Publish Settings
    7. Click Publish to deploy the application.

    Deploy on Google Cloud

    Clean Up

    To avoid incurring charges, you can delete the instances or simply stop them, although keep in mind that stopped instances can still incur costs related to storage.
    You can also delete your Cloud project to stop billing for all the resources used within that project.

    1. In the Cloud console, go to the Manage resources page.
    2. In the project list, select the project that you want to delete, and then click Delete.
    3. In the dialog, type the project ID, and then click Shut down to delete the project.