diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/sigma_footer.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/_shared_assets/Sigma_Footer.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/sigma_footer.png rename to site/sigmaguides/src/embedding_10_version_tagging_v3/_shared_assets/Sigma_Footer.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/facebook.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/facebook.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/facebook.png rename to site/sigmaguides/src/embedding_10_version_tagging_v3/assets/facebook.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/greencheckbox.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/greencheckbox.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/greencheckbox.png rename to site/sigmaguides/src/embedding_10_version_tagging_v3/assets/greencheckbox.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/horizonalline.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/horizonalline.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/horizonalline.png rename to site/sigmaguides/src/embedding_10_version_tagging_v3/assets/horizonalline.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/linkedin.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/linkedin.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/linkedin.png rename to site/sigmaguides/src/embedding_10_version_tagging_v3/assets/linkedin.png diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/pq_17.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/pq_17.png new file mode 100644 index 00000000..f6701c86 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/pq_17.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/sigma_footer.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/sigma_footer.png new file mode 100644 index 00000000..df51d771 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/sigma_footer.png differ diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/twitter.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/twitter.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/twitter.png rename to site/sigmaguides/src/embedding_10_version_tagging_v3/assets/twitter.png diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1.png new file mode 100644 index 00000000..954a0a97 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1a.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1a.png new file mode 100644 index 00000000..24ace424 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1a.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1b.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1b.png new file mode 100644 index 00000000..c9f73f61 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt1b.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt2.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt2.png new file mode 100644 index 00000000..c13a8c94 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt2.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt29a.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt29a.png new file mode 100644 index 00000000..79b1fe45 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt29a.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt3.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt3.png new file mode 100644 index 00000000..b6aae6c4 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt3.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt4.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt4.png new file mode 100644 index 00000000..b94c10c4 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt4.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt5.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt5.png new file mode 100644 index 00000000..7a9b961e Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt5.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt6.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt6.png new file mode 100644 index 00000000..e770c553 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt6.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt7.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt7.png new file mode 100644 index 00000000..13a205cd Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt7.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8.png new file mode 100644 index 00000000..9e675218 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8a.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8a.png new file mode 100644 index 00000000..25733fd5 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8a.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8b.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8b.png new file mode 100644 index 00000000..0087c13b Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8b.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8c.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8c.png new file mode 100644 index 00000000..ae561279 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8c.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8d.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8d.png new file mode 100644 index 00000000..c80e5dcb Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8d.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8e.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8e.png new file mode 100644 index 00000000..c21a851c Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8e.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8f.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8f.png new file mode 100644 index 00000000..22ef1b9d Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8f.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8g.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8g.png new file mode 100644 index 00000000..96826ee2 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vt8g.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_1.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_1.png new file mode 100644 index 00000000..f223cc30 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_1.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_10.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_10.png new file mode 100644 index 00000000..6a573122 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_10.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_11.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_11.png new file mode 100644 index 00000000..102b309e Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_11.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_12.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_12.png new file mode 100644 index 00000000..5a653606 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_12.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_13.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_13.png new file mode 100644 index 00000000..0901e33d Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_13.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_14.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_14.png new file mode 100644 index 00000000..f3f0387f Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_14.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_2.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_2.png new file mode 100644 index 00000000..c2e6e4bb Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_2.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_3.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_3.png new file mode 100644 index 00000000..163fe744 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_3.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_4.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_4.png new file mode 100644 index 00000000..4fc04f17 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_4.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_5.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_5.png new file mode 100644 index 00000000..84b6787e Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_5.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_6.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_6.png new file mode 100644 index 00000000..eee5e923 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_6.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_7.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_7.png new file mode 100644 index 00000000..d1c1739e Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_7.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_8.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_8.png new file mode 100644 index 00000000..2c6675a4 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_8.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_9.png b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_9.png new file mode 100644 index 00000000..5ff86302 Binary files /dev/null and b/site/sigmaguides/src/embedding_10_version_tagging_v3/assets/vtag_9.png differ diff --git a/site/sigmaguides/src/embedding_10_version_tagging_v3/embedding_10_version_tagging_v3.md b/site/sigmaguides/src/embedding_10_version_tagging_v3/embedding_10_version_tagging_v3.md new file mode 100644 index 00000000..47d92e70 --- /dev/null +++ b/site/sigmaguides/src/embedding_10_version_tagging_v3/embedding_10_version_tagging_v3.md @@ -0,0 +1,569 @@ +author: pballai +id: embedding_10_version_tagging_v3 +summary: embedding_10_version_tagging_v3 +categories: embedding +environments: web +status: Published +feedback link: https://github.com/sigmacomputing/sigmaquickstarts/issues +tags: embedding +lastUpdated: 2025-05-30 + +# Embedding 10: Version Tagging + +## Overview +Duration: 5 + +This QuickStart introduces you to Version Tagging in a Sigma embedded environment to manage promotion of workbooks via third-party CI/CD tools. Examples of popular Continuous Integration / Continuous Development (CI/CD) tools include GitLab, Jenkins, Circle CI, Bamboo and many others. + +Version tagging allows you to employ a software development lifecycle to control workbook versions, using tags. For example, Sigma can have development, staging, and production versions of a workbook and migrate changes as needed. This allows you to control which workbook versions are available to your users. + +When you create a tag and assign it to a workbook, you essentially **freeze the state of that workbook**. The process of tagging a workbook creates a duplicate that can be shared with other stakeholders and users. + +For example, you can create a "Production" tag and assign it to a workbook that is used by embed users. Moreover, you can tag additional versions of the same workbook such as "Development" or "Staging". These versions can be used by different stakeholders in your company for various purposes. Once reviewed, you can migrate this copy to production for your users via the CI/CD tool of your choice. + +The tagging design is flexible but at a high level, this is the workflow involved: + + + + + +In this QuickStart, we will demonstrate using Postman to simulate a CI/CD workflow and make manual edits to our local host application to evaluate the results of our API calls. In this way, we can demonstrate how a customer application using source control and pipelines could be used to make the same workflow work without asking the QuickStart user to create an excess amount of setup to become familiar with the tag workflow in Sigma. + +**Some steps may not be shown in detail as we assume you have completed any prerequisites and are familiar with Sigma workflows.** + +Before proceeding with this QuickStart guide, ensure you've completed the [Embedding 01: Getting Started](https://quickstarts.sigmacomputing.com/guide/embedding_01_getting_started_v3/index.html?index=..%2F..embedding#1) + + + +For more information on Sigma's product release strategy, see [Sigma product releases](https://help.sigmacomputing.com/docs/sigma-product-releases) + +If something is not working as you expect, here's how to [contact Sigma support](https://help.sigmacomputing.com/docs/sigma-support) + +### Target Audience +Semi-technical users who will be aiding in the planning or implementation of Sigma with embedding. No SQL or data engineering skills are needed to complete this QuickStart. It does assume some common computer skills like installing software, using Terminal, navigating folders and copy/paste operations. + +### Prerequisites + + + + + + + + + +![Footer](assets/sigma_footer.png) + + +## Create Sample Snowflake Environment +Duration: 10 + +We will need to create three schemas in Snowflake, each containing the same tables, with names and data adjusted to reflect the schema name. + +We’ve provided a Snowflake script to help you set this up. + + + +```code +USE ROLE ACCOUNTADMIN; +USE WAREHOUSE COMPUTE_WH; + +// 1: CREATE OR REPLACE DATABASE AND SET IT TO CURRENT +CREATE OR REPLACE DATABASE QUICKSTARTS; +USE DATABASE QUICKSTARTS; + +// 2: CREATE SCHEMAS +CREATE SCHEMA IF NOT EXISTS VT_DEV; +CREATE SCHEMA IF NOT EXISTS VT_PROD; + +// 3: CREATE AND LOAD DEV TABLES +USE SCHEMA VT_DEV; +CREATE OR REPLACE TABLE VT_DEV.company (company varchar); +CREATE OR REPLACE TABLE VT_DEV.company_country (company varchar, company_country varchar); +insert into vt_dev.company values ('Company 1 Dev'); +insert into vt_dev.company values ('Company 2 Dev'); +insert into vt_dev.company values ('Company 3 Dev'); +insert into vt_dev.company_country values ('Company 1 Dev', 'Company 1 Country Dev'); +insert into vt_dev.company_country values ('Company 2 Dev', 'Company 2 Country Dev'); +insert into vt_dev.company_country values ('Company 3 Dev', 'Company 3 Country Dev'); + +// 4: CREATE AND LOAD PROD TABLES +USE SCHEMA VT_PROD; +CREATE OR REPLACE TABLE VT_PROD.company (company varchar); +CREATE OR REPLACE TABLE VT_PROD.company_country (company varchar, company_country varchar); +insert into vt_prod.company values ('Company 1 Prod'); +insert into vt_prod.company values ('Company 2 Prod'); +insert into vt_prod.company values ('Company 3 Prod'); +insert into vt_prod.company_country values ('Company 1 Prod', 'Company 1 Country Prod'); +insert into vt_prod.company_country values ('Company 2 Prod', 'Company 2 Country Prod'); +insert into vt_prod.company_country values ('Company 3 Prod', 'Company 3 Country Prod'); + +// 6: CREATE ROLES FOR OUR USE CASES: +CREATE OR REPLACE ROLE VT_DEV; +CREATE OR REPLACE ROLE VT_PROD; + +// 7: GRANT USAGE PERMISSION ON THE DATABASE TO NEW ROLES: +GRANT USAGE ON DATABASE QUICKSTARTS TO VT_DEV; +GRANT USAGE ON DATABASE QUICKSTARTS TO VT_PROD; + +// 8: GRANT SELECT ON SCHEMA TO NEW ROLES: +GRANT USAGE ON SCHEMA QUICKSTARTS.VT_DEV TO VT_DEV; +GRANT USAGE ON SCHEMA QUICKSTARTS.VT_PROD TO VT_PROD; + +// 9: ALLOW NEW ROLES TO QUERY TABLE WE CREATED: +GRANT SELECT ON ALL TABLES IN SCHEMA QUICKSTARTS.VT_DEV TO ROLE VT_DEV; +GRANT SELECT ON ALL TABLES IN SCHEMA QUICKSTARTS.VT_PROD TO ROLE VT_PROD; + +// 10: CREATE USERS FOR EACH ROLE +CREATE OR REPLACE USER vtag_dev PASSWORD='Dev99!' MUST_CHANGE_PASSWORD = FALSE; +GRANT ROLE VT_DEV TO USER vtag_dev; + +CREATE OR REPLACE USER vtag_prod PASSWORD='Prod99!' DEFAULT_ROLE = VT_PROD MUST_CHANGE_PASSWORD = FALSE; +GRANT ROLE VT_PROD TO USER vtag_prod; + +//11: GRANT WAREHOUSE USAGE TO NEW ROLES: +GRANT USAGE ON WAREHOUSE COMPUTE_WH TO ROLE VT_DEV; +GRANT USAGE ON WAREHOUSE COMPUTE_WH TO ROLE VT_PROD; +``` + +Once the script completes Snowflake will return `Statement executed successfully.` + +We verified that the data exists by running the following query for each schema: + +```code +select * from vt_dev.company_country; +select * from vt_prod.company_country; +``` + +For example, for production, we see `Prod` appended to the row data: + + + +![Footer](assets/sigma_footer.png) + + +## Sigma Connections +Duration: 10 + +In this use case, we’ll use two separate connections to the same Snowflake account. + +Log into Sigma as an Administrator and head to the `Administration` / `Connections` page. + +Click `Create Connection`, select `Snowflake` and fill out the form. + +The values for `User`, `Password`, and `Role` were defined in our Snowflake script as: +``` +Connection Name: User: Password: Role: +Version Tagging - Development vtag_dev Dev99! VT_DEV +Version Tagging - Production vtag_prod Prod99! VT_PROD +``` +Use your Snowflake `ACCOUNT IDENTIFIER` for `Account`. + +Authentication is `Basic Auth`. + +For `Warehouse` use `COMPUTE_WH`. + + + +Click `Save`, and Sigma will validate the connection. + + + +To learn how to set up key-pair authentication in Sigma, see [Snowflake Key-pair Authorization](https://quickstarts.sigmacomputing.com/guide/security_snowflake_keypair_rotation/index.html?index=..%2F..index#0) + + +Before we add the other two connections (Staging and Prod), let's take a moment to ensure the Dev data is fully reachable. + +In the new connection, click the `Browse Connection` button: + + + +Verify that you can see table data for the `Company` and `Company Country` tables. + + + + + +Now repeat the process, adding new connections for `Staging` and `Prod`. Be sure to use the correct `User` and `Role` for each accordingly. + +You should now have two working connections. The main difference is the table data for each. + + + +![Footer](assets/sigma_footer.png) + + +## Sigma Tags +Duration: 5 + +Navigate to the `Administration` / `Tags` page. + +Click `Create Tag` to add a new tag. + +Set the name to Development. (Pick any color you prefer — it won’t affect this example). + + + + + +To read more about tags, see [Create and manage version tags](https://help.sigmacomputing.com/docs/create-and-manage-version-tags) + +Repeat the process to add a `Production` tag. You should now have two tags: + + + + + +![Footer](assets/sigma_footer.png) + + +## Sigma Workbook +Duration: 5 + +Create a new workbook, use the `Element bar` to add a `Data` > `Table` element to the page. For the source, select the `Version Tagging - DEVELOPMENT` connection. + +Select the `Sigma_VT` > `Company_Country` table: + + + +Click the `Save As` button and name the workbook `Embedding 10: Version Tagging`. + +Notice that the rows in the table contain the word `Dev` appended to each value. This is what we would expect given we are using the `Development Connection`. + + + +Open the workbook menu and select `Version` > `Version history`: + + + +This opens a sidebar showing all changes made that have been made as the workbook has been updated. + +In this case, we are on `VERSION 1`: + + + +Click the top entry in `Version History` and note the version number at the end of the URL. + +Also note the string next to #3 — this is the workbook GUID. It is useful to know this when using the REST API manually: + + + +Click the `Go to latest version` button and then click `Edit`. + +Change the table title to `County_List`, hit `Enter` and then `Publish`. + +Sigma recorded that change and then another change when we published it: + + + +Sigma also incremented the version from v1 to v2. + + + +We will reference version number 2 in our API call later when we promote to production. + +### Add a New Sigma Team +Since we have a `Production` tag, we want to add a new `Team` in Sigma to allow an embed user access to the workbook in the host application, instead of reviewing it in the Sigma UI. + +Create a new team called `Production`: + + + + + +### Tag the workbook +Return to the `Embedding 10: Version Tagging` workbook. + +Open the workbook menu and select `Versions` > `Tag this version...`: + + + +Set the tag for this workbook as shown below: + + + +We do not need to swap data sources right now as we are already using the `Development` data when we created the workbook. + +Before we get into the promotion workflow, we need to make sure that our parent application with the Sigma embed is working. + +Finally, copy the URL from your browser and store it in a text file — we’ll use it later. + +![Footer](assets/sigma_footer.png) + + +## Host Application Setup +Duration: 10 + +In the QuickStart [Embedding 01: Getting Started](https://quickstarts.sigmacomputing.com/guide/embedding_01_prerequisites/index.html?index=..%2F..index#0), we deployed a native application locally. + +For testing, we’ll use the pre-built embed page that demonstrates this approach. + +In VSCode, open a new Terminal session inside the `embedding_qs_series` project and run the following command: + +```code +npm start +``` + + + +Now edit the `.env` file to update a few values. + +The `CLIENT_ID` and `SECRET` values from the Getting Started QuickStart should still be present and working. If they’re missing or misconfigured, revisit the Getting Started QuickStart to complete that step. + +In the `# QS: version_tagging` section, we need to configure the values below, using the URL saved earlier for the `VERSION_TAGGING_BASE_URL=` value. + +Use only the required portion of the URL, as explained in the documentation, [What URL to use](https://help.sigmacomputing.com/docs/create-an-embed-api-with-json-web-tokens#what-url-to-use) + +For example, in our URL we removed the trailing section composed of this: +```code +?:nodeId=RWw-kr3_UG +``` + +This is the section that needs the URL: +```code +VERSION_TAGGING_BASE_URL= +VERSION_TAGGING_BASE_EMAIL=sales_person@example.com +VERSION_TAGGING_BASE_ACCOUNT_TYPE=View +VERSION_TAGGING_BASE_TEAMS=Production +``` + +Save the `.env` file. + +In a browser, open: +```code +http://localhost:3000/version_tagging/?mode=version_tagging +``` + + + +We should get an error `You don't have permission to access this page.`. + +This is because the embedded workbook has not been shared to our `Production` team yet and we don't have a `Development` team either. This is the expected result. + +At this point we could share the workbook with the `Production` team but it still won't render as the embedded workbook is assigned the `Development` version anyway. + +What we want to do is promote the workbook to `Production`, ensure that it is using the production Snowflake data and pass the pass the `Production` tag using the .env file at runtime. + +Do not share the workbook just yet. We need to promote the workbook to `Production` first, so it becomes available to share with the Production team. + +![Footer](assets/sigma_footer.png) + + +## Promote to Production +Duration: 20 + +In this section, we we'll use a combination of REST API calls and one edit to `embed-api.js` simulating a CI/CD workflow promotion to production. + +We will demonstrate this using Postman, which many developers are already familiar with. + + + + + + + +In order to use the Sigma API, we must first get a new bearer token. Follow the instructions in the [Sigma API with Postman](https://quickstarts.sigmacomputing.com/guide/sigma_api_with_postman/index.html?index=..%2F..index#0) QuickStart. + +We will use the API to tag the workbook with with updated values for the `Production` tag, workbook version, production connection, and production path. + +This will create a new copy of the workbook (as a tagged version). The original state of the workbook is also retained if we want to roll back to it later. + + + +First, we need to use the REST API to obtain the required references. We will need to obtain the following unique identifiers: + + + +We will use these values to update the Sigma workbook (in json format) using a REST POST message. + +Using a text editor (to temporarily hold the JSON) update each value that you obtain from the Postman calls. + +**Sample POST body for workbook tag update:** +```code +{ + "workbookId": "6DceMEz0RArq6F82wa02ha", + "workbookVersion": 2, + "tag": "Production", + "grantSourceAccess": true, + "sourceMappingConfig": [ + { + "fromConnectionId": "b44fef40-b1b3-4059-b530-7e3eac51e712", + "toConnectionId": "0c750f29-607b-4437-a824-d287431f69e8", + "paths": [{ "fromPath": ["SIGMA_VT", "VT_DEV", "COMPANY_COUNTRY"], "toPath": ["SIGMA_VT", "PROD", "COMPANY_COUNTRY"] }] + } + ], + "sourceVersions": {} + } +``` + + + +Open Postman and use the `Authenticate` method to get a bearer token: + + + +Open the request named `Returns a workbook based on workbookId` in the `workbooks` folder. This will get the list of all workbooks. + +Click `Send` and locate the workbook named `Embedding 10: Version Tagging` in the return: + + + +Note the workbook's `sourceWorkbookVersion` value. This is the version number for the workbook and we want to carry that forward when we promote. + +Copy its `workbookUrlId` value and update the JSON sample for `workbookId`. + +We now need to get the GUIDs for the development and production Sigma connections using the method `Returns a list of available connections`: + +Copy the two GUIDs (one for development and another for production) from the return and update the json code. + +For example, for development, we searched for and found: + + + +Use the values to update the sample POST body workbook tag update values. For example: +```code +{ + "workbookId": "5P9Mtgt6Mq10NE6p599BeM", + "workbookVersion": 2, + "tag": "Production", + "grantSourceAccess": true, + "sourceMappingConfig": [ + { + "fromConnectionId": "309d9b74-28a2-4e84-a04a-0c3543d8885c", + "toConnectionId": "4f841df6-d307-496a-8742-cadd2e1baa6c", + "paths": [{ "fromPath": ["SIGMA_VT", "VT_DEV", "COMPANY_COUNTRY"], "toPath": ["SIGMA_VT", "VT_PROD", "COMPANY_COUNTRY"] }] + } + ], + "sourceVersions": {} + } +``` + +### Promote +Open the `Tag a workbook` method and revise the `Body` with the adjusted values: + + + +Click `Send` to submit the API request. A `200 Statu`s should be returned. The API should return with a `200 Status`. + +We have now tagged the workbook to `Production` and a `taggedWorkbookVersion = 1`: + + + +Returning the Sigma workbook (and refreshing the page), we can see the workbook was tagged `Production` in its `Version history`: + + + +This was done by the API call we made. + +### Share with team +Share the workbook with the `Production` team. You can grant the `Production` team different levels of permission and also the ability to access one or more workbook tags too. + +We will limit the team to just `View` and the `Production` tag: + + + +### Revise .env +Append `/tag/Production` to the value of `VERSION_TAGGING_BASE_URL` and `VERSION_TAGGING_TEAMS` to `Production`: + + + +Save the changes. + + + +Refresh the sample host application page. + +You should now see the table using the production connection’s data: + + + +### Reverting from production to development + +To revert, rerun the `Tag a workbook` API call, changing the tag to `Development` and flipping the values as shown: + + + +Next, adjust `.env` for development, setting the value for `VERSION_TAGGING_BASE_URL` to have `/tag/Development` appended to it. + +Save the changes. + +However, when we refresh the host application, we still see the production data. This is because the `Production` team is not permitted to see the `Development` tag. + +Enable the `Production` team to access the `Development` tag: + + + + + +You should now see the development data shared with the `Production` team: + + + +![Footer](assets/sigma_footer.png) + + +## What we've covered +Duration: 5 + +In this QuickStart, we reviewed how to use Sigma's Version Tagging to manually manage a CI/CD workflow that promotes or demotes a workbook while updating the underlying data shown to the embedded user. + +**Additional Resource Links** + +[Blog](https://www.sigmacomputing.com/blog/)
+[Community](https://community.sigmacomputing.com/)
+[Help Center](https://help.sigmacomputing.com/hc/en-us)
+[QuickStarts](https://quickstarts.sigmacomputing.com/)
+ +Be sure to check out all the latest developments at [Sigma's First Friday Feature page!](https://quickstarts.sigmacomputing.com/firstfridayfeatures/) +
+ +[](https://twitter.com/sigmacomputing)  +[](https://www.linkedin.com/company/sigmacomputing)  +[](https://www.facebook.com/sigmacomputing) + +![Footer](assets/sigma_footer.png) + + + + + + diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/1.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/1.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/1.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/1.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/10.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/10.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/10.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/10.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/2.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/2.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/2.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/2.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/3.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/3.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/3.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/3.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/4.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/4.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/4.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/4.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/5.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/5.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/5.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/5.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/6.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/6.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/6.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/6.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/7.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/7.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/7.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/7.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/8.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/8.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/8.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/8.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/9.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/9.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/9.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/9.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/caret.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/caret.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/caret.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/caret.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/closeview.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/closeview.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/closeview.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/closeview.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/crane.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/crane.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/crane.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/crane.png diff --git a/site/sigmaguides/src/embedding_16_public_access_v3/assets/facebook.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/facebook.png new file mode 100644 index 00000000..fa3f0e02 Binary files /dev/null and b/site/sigmaguides/src/embedding_16_public_access_v3/assets/facebook.png differ diff --git a/site/sigmaguides/src/embedding_16_public_access_v3/assets/greencheckbox.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/greencheckbox.png new file mode 100644 index 00000000..69cb876e Binary files /dev/null and b/site/sigmaguides/src/embedding_16_public_access_v3/assets/greencheckbox.png differ diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/heart_icon.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/heart_icon.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/heart_icon.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/heart_icon.png diff --git a/site/sigmaguides/src/embedding_16_public_access_v3/assets/horizonalline.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/horizonalline.png new file mode 100644 index 00000000..7c49d872 Binary files /dev/null and b/site/sigmaguides/src/embedding_16_public_access_v3/assets/horizonalline.png differ diff --git a/site/sigmaguides/src/embedding_16_public_access_v3/assets/linkedin.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/linkedin.png new file mode 100644 index 00000000..d1a0636d Binary files /dev/null and b/site/sigmaguides/src/embedding_16_public_access_v3/assets/linkedin.png differ diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_1.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_1.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_1.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_1.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_2.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_2.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_2.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_2.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_3.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_3.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_3.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_3.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_4.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_4.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_4.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_4.png diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_5.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_5.png similarity index 100% rename from site/sigmaguides/src/embedding_15_public_access_v3/assets/pa_5.png rename to site/sigmaguides/src/embedding_16_public_access_v3/assets/pa_5.png diff --git a/site/sigmaguides/src/embedding_16_public_access_v3/assets/sigma_footer.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/sigma_footer.png new file mode 100644 index 00000000..df51d771 Binary files /dev/null and b/site/sigmaguides/src/embedding_16_public_access_v3/assets/sigma_footer.png differ diff --git a/site/sigmaguides/src/embedding_16_public_access_v3/assets/twitter.png b/site/sigmaguides/src/embedding_16_public_access_v3/assets/twitter.png new file mode 100644 index 00000000..5a827d72 Binary files /dev/null and b/site/sigmaguides/src/embedding_16_public_access_v3/assets/twitter.png differ diff --git a/site/sigmaguides/src/embedding_15_public_access_v3/embedding_15_public_access_v3.md b/site/sigmaguides/src/embedding_16_public_access_v3/embedding_16_public_access_v3.md similarity index 98% rename from site/sigmaguides/src/embedding_15_public_access_v3/embedding_15_public_access_v3.md rename to site/sigmaguides/src/embedding_16_public_access_v3/embedding_16_public_access_v3.md index c0ef16c3..a3cd8916 100644 --- a/site/sigmaguides/src/embedding_15_public_access_v3/embedding_15_public_access_v3.md +++ b/site/sigmaguides/src/embedding_16_public_access_v3/embedding_16_public_access_v3.md @@ -1,6 +1,6 @@ author: pballai -id: embedding_1embedding_15_public_access_v35_public_v3 -summary: embedding_15_public_access_v3 +id: embedding_16_public_access_v3 +summary: embedding_16_public_access_v3 categories: Embedding environments: web status: published @@ -8,7 +8,7 @@ feedback link: https://github.com/sigmacomputing/sigmaquickstarts/issues tags: embedding lastUpdated: 2024-05-19 -# Embedding 15 Public Access +# Embedding 16: Public Access ## Overview Duration: 5