Azure (SSO) to Snowflake
In this tutorial we will show how to setup authentication to Snowflake using SSO with Azure Microsoft Entra ID Identity Provider which used to called Azure Active Directory.
Video
Azure
Lets start in azure by setting up the SSO and then adding the users to the approved list.
Setup
Lets start in azure by logging into our azure and navigate to Microsoft Entra ID.
Next lets click on Enterprise Applications on the left navbar.
In the Browse Azure AD Gallery search bar, search for Snowflake, and choose Snowflake for Microsoft Entra ID application.
Give your Snowflake application a name, then click the Create button at the bottom.
Once the application is created, on the left side choose Single sign-on, then choose SAML in the middle panel.
In the middle pane under the Basic SAML configuration section, click the Edit button.
Next we'll want to get our Snowflake account identifier url. An example can be seen below that comes from AWS US West (Oregon)
or you can use this chart (1).
-
URL type URL format Regional https://locator.region.snowflakecomputing.com Organization https://organization-name.snowflakecomputing.com Connection https://organization-connection.snowflakecomputing.com Regional Privatelink https://locator.region.privatelink.snowflakecomputing.com Organization Privatelink https://organization-name.privatelink.snowflakecomputing.com Connection Privatelink https://organization-connection.privatelink.snowflakecomputing.com
Warning
If you format your URL incorrectly the SSO login will not work. Please read the Account Identifiers documentation to learn how to format your URL based on your snowflake service provider and server location.
In the Basic SAML Configuration section, configure your Identifier (Entity ID) with your snowflake account identifier URL and also again for your Reply URL (Assertion consumer service URL) but follow it with /fed/login
and click save.
Go back to the application's SAML-based Sign-on page, scroll down to the SAML Certificates section. Download the Federation Metadata XML. We will use this file in our Snowflake steps.
Add users
Warning
If you don't add the user in the Azure AD group they will not be able to use the SSO login on Snowflake.
Lets add users into the azure AD group for the application. First click on "Users and groups" on the left side navbar and then "add user/group".
Select the user or groups you want to add. The search bar can be very helpful when you have alot of users/groups.
Snowflake
Next we will setup Snowflake with the information we got from our federation metadata xml
file. To make this process easier I suggest formatting your XML file so it's easier to look through. I used VS code and an xml formatter to accomplish this. Once you have the file open in vs code and the xml extension installed, select all the code and right clicl -> "Format Document".
Setup
Lets open a worksheet in snowflake and enter the code below by entering in the necessary areas from our federation metadata xml file..
-
<EntityDescriptor ID="_8416250f-50fb-...8bcd335e92" entityID="https://sts.windows.net/9a2d78cb-73...fc1ac5ef57a7/" xmlns="urn:oasis:names:tc:SAML:2.0:metadata">
-
<SingleSignOnService Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="https://login.microsoftonline.com/9a2d78c...-fc1ac5ef57a7/saml2" />
-
<X509Certificate> MIIC8DCCAdigAwIBAgIQQH4r9rnBiKlPEFVEjpdNhTANBgkqhkiG9w0BAQ ....... Y9B1uSBpb4OmtWZ/LRNzHBDcDNbR oQ6PiPd2yWhtUfbYClOoNcMFOkk8E </X509Certificate>
status |
---|
Integration AZUREADINTEGRATION successfully created. |
Success
If you configured the Basic SAML configuration in the azure section using the Regional Locator Snowflake URL (1), you can move on to the next step by adding users and testing your login.
- This is an example of a regional locator URL: https://mbb41651.snowflakecomputing.com/
If you've chosen to use a different URL format then regional locator
If you've chosen to use a different URL format such as Organization, Connection or one of the Privatelink URLs, follow the steps below.
Review the current integration configuration. Confirm the values of the SAML2_SNOWFLAKE_ACS_URL
and SAML_SNOWFLAKE_ISSUER_URL
parameters are using the Regional Locator URL (1).
- This is an example of a regional locator URL: https://mbb41651.snowflakecomputing.com/
If they are not, alter the security integration by using the code below.
Notes:
- The above statement uses the Organization URL as an example. You should use the URL format the Azure Single sign on application was configured with.
- The value for the parameter SAML2_SNOWFLAKE_ACS_URL ends with /fed/login.
- The value for the parameter SAML2_SNOWFLAKE_ISSUER_URL is only the Snowflake account URL, in the format matching the Azure application configuration.
Add or modify users.
Warning
Your users must use their email for logging into Snowflake that matches in Azure AD or it will not work.
Note
If you already have users in Snowflake and they already are using their email for logging in then you can skip this section.
Lets add the user to snowflake using the users email. It is also suggested to give that user a role at this point.
If you already have users in snowflake but when they were created they didn't use their email.
Test login
Note
If you get an error stating the user doesnt exist, you either forgot to add the user in Azure or Snowflake.
Lets make sure your Azure AD is working. Logout of your Snowflake account and you should now see the Azure AD login button.