Module 05 · Lesson 12 of 15Detailed study · about 20 min

Azure Blob: tenant consent and storage access

An Azure integration uses a service principal in your tenant. Tenant consent enables the identity relationship; a storage role assignment then authorizes access to blobs.

Understand the idea

Create the integration using the tenant ID and an azure:// URL. DESC returns AZURE_CONSENT_URL and AZURE_MULTI_TENANT_APP_NAME. An authorized tenant administrator opens the returned consent URL and approves the request.

Key ideas in simple English
ConceptWhat it means
TenantThe Microsoft identity directory for the integration.
ConsentAllows the Snowflake application relationship in that tenant.
Blob data roleAuthorizes actual reads or writes at the chosen storage scope.

A concrete example

Record the consent URL and app name, complete tenant consent and the container-scoped data-role assignment before proceeding.

Remember: Consent and storage authorization are two separate steps.

Explain it step by step · full theory

Understand the idea

Create the integration using the tenant ID and an azure:// URL. DESC returns AZURE_CONSENT_URL and AZURE_MULTI_TENANT_APP_NAME. An authorized tenant administrator opens the returned consent URL and approves the request.

Then find the service principal identified by the application name and grant Storage Blob Data Reader at the intended container scope for a read-only lab. Consent alone is not a blob read permission. Identity creation and role assignment can take time to propagate.

Follow the workflow

Use the Blob endpoint form shown in the template, not a guessed file-browser URL. Storage firewall and encryption settings may also affect access. Use the approved account/region connectivity design rather than broadening public access to make a lab pass.

Write access belongs to a separate export requirement. Storage Blob Data Contributor includes broader actions, including deletion; do not assign it merely to preview a CSV.

Words used in this lesson
Tenant
The Microsoft identity directory for the integration.
Consent
Allows the Snowflake application relationship in that tenant.
Blob data role
Authorizes actual reads or writes at the chosen storage scope.

See how it works

Choose a step to explore the idea at your own pace.

Open the interactive explanation
Interactive explainer1 / 3

Azure Blob: tenant consent and storage access

Source files
Storage location

Locate the data

An Azure integration uses a service principal in your tenant. Tenant consent enables the identity relationship; a storage role assignment then authorizes access to blobs.

Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.

Read the complete diagram explanation
  1. Locate the data

    An Azure integration uses a service principal in your tenant. Tenant consent enables the identity relationship; a storage role assignment then authorizes access to blobs.

  2. Configure the boundary

    Create the integration using the tenant ID and an azure:// URL. DESC returns AZURE_CONSENT_URL and AZURE_MULTI_TENANT_APP_NAME. An authorized tenant administrator opens the returned consent URL and approves the request.

  3. Observe the outcome

    Consent and storage authorization are two separate steps.

Try the SQL or command

Read → predict → run in your learning environment → compare. You can also learn by reading without an account.

New to SQL? Where to run it and how to read it

A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.

  1. No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
  2. For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
  3. Read the entire example, including comments beginning with --. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor.
  4. Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
SELECT / FROM
Choose the values to return / identify their input.
VALUES / COLUMN1
VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
AS / WITH
AS gives a result a readable name. WITH names a temporary query step within one statement.
NULL / ::
NULL means missing or unknown. The :: notation converts a value to a named data type.
Session
One connection and its settings. Keep related transaction steps in the same session.
Database.schema.table
A full address for stored data. It is separate from the warehouse that processes queries.

Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →

Help with common practice errors
  • No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
  • Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
  • Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
  • Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Shared orders.csv and internal-stage setup
Our shared source file

Four orders, one CSV contract

Every CSV lesson uses this fictional orders.csv. One data record represents one order. The first line is a header; the four remaining lines are data. All amounts use the same fictional currency.

order_id,customer_name,amount,order_date
101,"Asha, Rao",120.50,2025-01-01
102,Ben,,2025-01-02
103,Cara,NULL,2025-01-03
104,Dev,0,2025-01-04

Notice the comma inside Asha’s quoted name, Ben’s empty amount, Cara’s literal NULL marker and Dev’s zero. We will follow these exact values from file bytes to parsed fields.

Setup order for optional manual practice
  1. Select an authorized sandbox database and schema. Keep this context consistent across your client sessions.
  2. Create orders_csv_v1 using lesson 3, then orders_stage using lesson 5. Use fresh sandbox names; do not replace existing shared objects.
  3. Save the text above as a UTF-8 file named orders.csv. Upload it with a supported local client or the named-stage upload interface.
  4. Keep only this sample file under the incoming/ prefix when following the four-row expected results.
  5. Select an authorized warehouse for the staged SELECT examples. File previews use compute; this website runs no SQL.

The examples assume the required role privileges described in the lessons. The external-stage and JSON examples have their own additional setup and are clearly marked.

Before running this lesson

Manual learning examples, not executed here. Use L2_OBJECTS_LAB.SALES from Module 03 and an authorized warehouse for previews. Run shared format/stage setup once. Cloud examples are templates: replace every <placeholder>, use approved cloud resources, and follow the provider setup before running SQL. No credentials belong in this website.

Create the Azure integration

SQL · example
CREATE STORAGE INTEGRATION m5_azure_read
 TYPE=EXTERNAL_STAGE STORAGE_PROVIDER=AZURE ENABLED=TRUE
 AZURE_TENANT_ID='<tenant-id>'
 STORAGE_ALLOWED_LOCATIONS=('azure://<storage-account>.blob.core.windows.net/<container>/incoming/')
 STORAGE_BLOCKED_LOCATIONS=('azure://<storage-account>.blob.core.windows.net/<container>/incoming/private/');
DESC INTEGRATION m5_azure_read;

What to expect and why

Record the consent URL and app name, complete tenant consent and the container-scoped data-role assignment before proceeding.

Create and inspect the stage after consent and grants

SQL · example
CREATE STAGE m5_azure_stage
 URL='azure://<storage-account>.blob.core.windows.net/<container>/incoming/'
 STORAGE_INTEGRATION=m5_azure_read
 FILE_FORMAT=(FORMAT_NAME='orders_csv_v1');
LIST @m5_azure_stage;

What to expect and why

A successful list shows visible blobs under incoming/. File content still needs a staged SELECT check.

Check your understanding

Choose an answer, then check your reasoning. This is practice, not a scored test.

Does tenant consent alone authorize reading the container?

Try it yourself

Which role suits a read-only preview lab?

Compare your reasoning

Storage Blob Data Reader at the approved container scope; grant write/delete capabilities only for a separate justified operation.

Official sources and curriculum

Module 05 · See module scope