Step 3: Create the API Integration for Azure in Snowflake¶
This topic provides instructions for creating an API integration object in Snowflake to work with your proxy service (i.e. Azure API Management service). The instructions are the same regardless of whether you are using the Azure Portal or ARM template.
You need the following information to create the API integration for Azure in Snowflake:
Azure Function App AD Application ID(from your tracking worksheet)
Azure AD Tenant ID (as described in the Prerequisites section for planning an external function)
Create the API Integration Object¶
Use the CREATE API INTEGRATION command to create the API integration object:
If you haven’t already, log into the Classic Console.
Execute the USE ROLE command to use the ACCOUNTADMIN role or a role with the CREATE INTEGRATION privilege. For example:
use role has_accountadmin_privileges;
Enter a CREATE API INTEGRATION statement. The statement should look similar to the following:
create or replace api integration <integration_name> api_provider = azure_api_management azure_tenant_id = '<tenant_id>' azure_ad_application_id = '<azure_application_id>' api_allowed_prefixes = ('<url>') enabled = true;
In the statement:
<integration_name>with a unique integration name (e.g.
my_api_integration_name). The name must follow the rules for Object Identifiers.
In addition, record the integration name in the
API Integration Namefield in your tracking worksheet. You will need the name when you execute the CREATE EXTERNAL FUNCTION command later in the creation process.
<tenant_id>with your Azure AD Tenant ID.
As an alternative, you can use your domain (e.g.
<azure_application_id>with the value from the
Azure Function App AD Application IDfield in your tracking worksheet.
<url>with the appropriate URL.
Usually, this is the URL of the proxy service (i.e. Azure API Management service), in the following format:
However, you can restrict the URLs to which this API integration can be applied by appending an appropriate suffix, in which case the URL has the following format:
The URL you enter depends on whether you are using the Azure Portal or ARM template to create your external function:
- Azure Portal
Use the values from the
API Management service nameand
API Management API URL suffixfields in your tracking worksheet. For example, your URL should look similar to:
This should match the base URL and suffix from the API Management service Settings tab for your imported API. If convenient, you can copy the value from the tab instead.
- ARM template
Use the value from the
API Management URLfield in your tracking worksheet.
If you haven’t already, execute the CREATE API INTEGRATION statement you entered.