Authorized views and datasets allow you to share query results with certain users, groups or even entire projects without giving them access to the underlying tables.
You can authorize either individual views or entire datasets, depending on your needs. However, it’s important to understand the difference:
Authorizing a Dataset: If you authorize an entire dataset, users in the receiving project will have access to all tables within it.
Authorizing a View: If you only want to share specific data, you can authorize individual views. This restricts access to just the data defined within the view.
How to Create Authorized Views or Datasets
Let's say you have a source project (Project A) containing the data you want to share, and a destination project (Project B) where you want to grant access.
- Create a dataset or a view in the destination project (Project B). You'll authorize access to this dataset or view from the source project. You can create a view or dataset using any of the methods described in Google's documentation. For this example, let's assume you created a dataset or view in Project B.
- In the source project (Project A), authorize the dataset or view from Project B.
- Navigate to the dataset in Project A that contains the data you want to share.
- Click the three vertical dots (Actions) icon next to the dataset name and select Open.
- In the details pane, click the Sharing tab.
- Click either Authorize Views or Authorize Datasets.
- In the "Authorized Dataset" or "Authorized View" pane:
- Enter the Dataset ID or View ID of the dataset or view you created in Project B, using the following format:
- For authorizing a dataset: PROJECT_B.AUTHORIZED_DATASET
- For authorizing a view: PROJECT_B.DATASET_IN_PROJECT_B.AUTHORIZED_VIEW
- Click Add Authorization.
- Click Close.
- Enter the Dataset ID or View ID of the dataset or view you created in Project B, using the following format:
- Access the Shared Data: Users in Project B can now query the view or dataset you created to access the shared data without having direct access to the tables in Project A.
Have questions? Reach out to help@techallies.org.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article