snowflake-cloud-data-platform

Snowflake Storage Integration works for * but not specific blob locations


Instead of altering my storage integration in the development environment I did a CREATE OR ALTER when adding a new Azure storage location to the STORAGE_ALLOWED_LOCATIONS. I have added back USAGE to the storage integration for the necessary users but when i create a STAGE for any of the old and also the new blob locations i get the following message.

Location 'azure://myblob.blob.core.windows.net/my-container/' is not allowed by integration My_Integration_NONPROD. Please use DESC INTEGRATION to check out allowed and blocked locations.

If i change the STORAGE_ALLOWED_LOCATIONS = ('*') I am able to create a STAGE and test it with a ls @mystage just fine.

This is the replace I ran that broke the working storage integration

CREATE OR REPLACE STORAGE INTEGRATION My_Integration_NONPROD
type = external_stage
storage_provider = azure
enabled = true
azure_tenant_id = '111111'
storage_allowed_locations = ('azure://st1.blob.core.windows.net/cont/,azure://st2.blob.core.windows.net/cont/,azure://st3.blob.core.windows.net/cont/,azure://stnew.blob.core.windows.net/cont/');

This is what I used to create the stage

CREATE OR REPLACE STAGE db.schema.stage_name
storage_integration = My_Integration_NONPROD
url = 'azure://stnew.blob.core.windows.net/cont/';

What am I missing?


Solution

  • You use a wrong syntax/format for storage_allowed_locations. Here is the correct syntax:

    CREATE OR REPLACE STORAGE INTEGRATION My_Integration_NONPROD
    type = external_stage
    storage_provider = azure
    enabled = true
    azure_tenant_id = '111111'
    storage_allowed_locations = ('azure://st1.blob.core.windows.net/cont/','azure://st2.blob.core.windows.net/cont/','azure://st3.blob.core.windows.net/cont/','azure://stnew.blob.core.windows.net/cont/');