Deploy Google Cloud Framework Data Foundation for SAP

Join Sign in

Deploy Google Cloud Framework Data Foundation for SAP

1 hour 1 Credit


Google Cloud self-paced labs logo


SAP Cortex data foundation consists of three different data sets: Replicated SAP ECC tables, CDC processed tables and views, and SAP reporting views.

The Data Foundation for Google Cloud Cortex Framework is a set of analytical artifacts, that can be automatically deployed together with reference architectures.

In this lab you will deploy the analytical views and models that serve as a foundational data layer for the Google Cloud Cortex Framework in BigQuery. You can find an entity-relationship diagram on GitHub at this location.


In this lab, you will:

  • Set up prerequisites for deploying the SAP Cortex Data Foundation on GCP

  • Create the required datasets in BigQuery for hosting SAP ECC, CDC processed tables and views, and SAP reporting views

  • Execute the deployment of the Data Foundation for SAP

  • Manually deploy the data to the datasets created in BigQuery

Setup and Requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources will be made available to you.

This hands-on lab lets you do the lab activities yourself in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials that you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito or private browser window to run this lab. This prevents any conflicts between your personal account and the Student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab---remember, once you start, you cannot pause a lab.
Note: If you already have your own personal Google Cloud account or project, do not use it for this lab to avoid extra charges to your account.

How to start your lab and sign in to the Google Cloud Console

  1. Click the Start Lab button. If you need to pay for the lab, a pop-up opens for you to select your payment method. On the left is the Lab Details panel with the following:

    • The Open Google Console button
    • Time remaining
    • The temporary credentials that you must use for this lab
    • Other information, if needed, to step through this lab
  2. Click Open Google Console. The lab spins up resources, and then opens another tab that shows the Sign in page.

    Tip: Arrange the tabs in separate windows, side-by-side.

    Note: If you see the Choose an account dialog, click Use Another Account.
  3. If necessary, copy the Username from the Lab Details panel and paste it into the Sign in dialog. Click Next.

  4. Copy the Password from the Lab Details panel and paste it into the Welcome dialog. Click Next.

    Important: You must use the credentials from the left panel. Do not use your Google Cloud Skills Boost credentials. Note: Using your own Google Cloud account for this lab may incur extra charges.
  5. Click through the subsequent pages:

    • Accept the terms and conditions.
    • Do not add recovery options or two-factor authentication (because this is a temporary account).
    • Do not sign up for free trials.

After a few moments, the Cloud Console opens in this tab.

Note: You can view the menu with a list of Google Cloud Products and Services by clicking the Navigation menu at the top-left. Navigation menu icon

Activate Cloud Shell

Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.

  1. Click Activate Cloud Shell Activate Cloud Shell icon at the top of the Google Cloud console.

When you are connected, you are already authenticated, and the project is set to your PROJECT_ID. The output contains a line that declares the PROJECT_ID for this session:

Your Cloud Platform project in this session is set to YOUR_PROJECT_ID

gcloud is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.

  1. (Optional) You can list the active account name with this command:

gcloud auth list
  1. Click Authorize.

  2. Your output should now look like this:


ACTIVE: * ACCOUNT: To set the active account, run: $ gcloud config set account `ACCOUNT`
  1. (Optional) You can list the project ID with this command:

gcloud config list project


[core] project = <project_ID>

Example output:

[core] project = qwiklabs-gcp-44776a13dea667a6 Note: For full documentation of gcloud, in Google Cloud, refer to the gcloud CLI overview guide.

Task 1. Enable Required Services

  1. Using the Cloud Shell, store the project ID and enable the required services by executing the following commands:

export PROJECT_ID=$(gcloud config get-value project) gcloud services enable \ \ \ \
  1. The result of running this command should be similar to the following:


Click Check my progress to verify the objective. Enable Required Services

Task 2. Create Datasets in BigQuery

The datasets which will host the replicated SAP ECC tables, CDC processed tables and views and SAP reporting views must be created in BigQuery prior to running the deployment job to import the sample data.

  1. Run the following commands to create the required BigQuery datasets:

bq mk --dataset CDC_PROCESSED bq mk --dataset SAP_REPLICATED_DATA bq mk --dataset SAP_REPORTING
  1. Verify the datasets are created successfully. This should look similar to the image below:


Click Check my progress to verify the objective. Create Datasets in BigQuery

Task 3. Update Permission for Cloud Build Service Account

  1. In the Google Cloud Console, type IAM in the top search box and select IAM & Admin


  1. In the Filter input at the top of the IAM Principals list, type @cloudbuild and select the result.


  1. Click the Edit principal icon on the right side of the table and add the following two roles to the Cloud Build Service Account:
  • BigQuery Data Editor
  • BigQuery Job User

Click Save.


Click Check my progress to verify the objective. Update Permission for Cloud Build Service Account

Task 4. Create Bucket for Deployment

A storage bucket will be required to leave any processing scripts in that are generated. These scripts can be manually moved into a Cloud Composer instance after deployment.

  1. Run the following command in Cloud Shell to create a bucket for the deployment

gsutil mb -l US gs://$PROJECT_ID-sap-cortex
  1. Store the cloud storage bucket name in an environment variables for later reference:

export GCS_BUCKET=$PROJECT_ID-sap-cortex

Click Check my progress to verify the objective. Create Bucket for Deployment

Task 5. Run the Cortex Deployment Checker

You can now run a simple script, the Cortex Deployment Checker, to simulate the deployment steps and make sure the prerequisites are fulfilled.

  1. In Cloud Shell, clone the repository

git clone
  1. From Cloud Shell , change into the directory:

cd mando-checker
  1. Run the following build command to simulate running the deployment:


The result of running the Cortex Deployment Checker should yield similar to the following: cortex_checker_output

Task 6. Run the Deployment Job for Data Foundation for Google Cloud Cortex Framework

You are now ready to run the deployment job for Data Foundation for Google Cloud Cortex Framework.

  1. Clone the cortex-data-foundation repository using the command below:

cd ~ git clone --recurse-submodules
  1. Change into the cortex-data-foundation directory

cd cortex-data-foundation
  1. Run the deployment job by executing the following command in Cloud Shell:

gcloud builds submit --project $PROJECT_ID \ --substitutions \ _PJID_SRC=$PROJECT_ID,_PJID_TGT=$PROJECT_ID,_DS_CDC=CDC_PROCESSED,_DS_RAW=SAP_REPLICATED_DATA,_DS_REPORTING=SAP_REPORTING,_GCS_BUCKET=$GCS_BUCKET,_TGT_BUCKET=$GCS_BUCKET,_TEST_DATA=true,_DEPLOY_CDC=true NOTE: Executing the above command will run the deployment job to populate the BigQuery datasets created previously with the Cortex Data Foundation sample data. This process can take up to an hour to deploy. To view the results of the job execution without waiting the full hour, you will manually import the data into the datasets in the next task of this lab.

Click Check my progress to verify the objective. Run the Deployment Job for Data Foundation for Google Cloud Cortex Framework

Task 7. Manually Import the Data Foundation for Google Cloud Cortex Framework

In order to shorten the length of this lab, you will cancel the job execution ran in Task 6 of this lab in order to see its results without waiting a full hour.

  1. In Cloud Shell, press CTRL+C to cancel the previously run job's execution. You should see a job status of CANCELLED if performed correctly.


  1. Run the following commands to create a new directory to manually import the Data Foundation data from.

cd ~ mkdir cortex_data_foundation_deploy cd cortex_data_foundation_deploy
  1. Run the following command to copy the script that will manually import all of the processed datasets pre-loaded in a Google Cloud Storage bucket:

gsutil cp gs://sap-cortex-labs/ . chmod +x

4.Open the Cloudshell Editor and edit the file downloaded in cortex_data_foundation_deploy folder. Replace line number 14 comment with the code

gsutil cp -r gs://$BUCKET_NAME/* .

5.Now run the following command to execute the script:

  1. Once completed, navigate to the BigQuery Explorer view and confirm that the datasets are now populated with the manually imported data.


Click Check my progress to verify the objective. Manually Import the Data Foundation for Google Cloud Cortex Framework


In this lab, you learned how to leverage the Data Foundation for Google Cloud Cortex Framework to import a set of analytical artifacts that can be utilized with SAP sample reference architectures.

Next Steps / Learn More

Check out the following for more information on Google Cloud Cortex Framework:

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated: May 27, 2022
Lab Last Tested: May 27, 2022

Copyright 2022 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.