Search code examples
azuresnowflake-cloud-data-platformsnowflake-stage

Failure using stage area. Cause: [Server failed to authenticate the request] by using Azure Storage


I am new to snowflake. I am trying to create external stage by using azure blob storage in snowflake. I have successfully created the stage but I cannot able to access(list @Employee_New) the stage with following error message i.e.

Error: "Failure using stage area. Cause: [Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature. (Status Code: 403; Error Code: AuthenticationFailed)]"

Note: I have checked the expire date of SAS token, checked the roles, and added the all permissions in Azure but none of them worked for me.

Can anyone help me how to resolve the issue.

Here is the command(s) what I have done so far

CREATE STAGE Employee_New 
    URL = 'azure://sampleblob123456.blob.core.windows.net/sampleblob/Input/employee.csv' 
    CREDENTIALS = ( AZURE_SAS_TOKEN = '*****' ) 
    DIRECTORY = ( ENABLE = true ) 
    COMMENT = 'New Stage Environment';````

Solution

  • I tried in my environment and got the below results:

    Initially, I got the same error in my environment.

    enter image description here

    The above error occurs may be the wrong URL or sas-token that you have provided.

    You can get the SAS-token from the portal.

    enter image description here

    I followed this Document to create an external stage.

    Command:

    CREATE STAGE Employee_456
    URL = 'azure://venkat123.blob.core.windows.net/test1/sample1/input/' 
    CREDENTIALS = ( AZURE_SAS_TOKEN = '?your-sas-token' ) 
    DIRECTORY = ( ENABLE = true ) 
    COMMENT = 'New Stage Environment';
    

    Output: enter image description here

    enter image description here