-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Synapse Serverless Database #18234
Comments
@leo-schick any updates on this? did you managed to create this with Terraform? |
No. I created it now manually and live with it 🫤 hope this gets added soon |
Good day. Are you able to share the steps you did to create a "serverless db" on Synapse? |
leo-schick, thanks. I am looking to create this in Terraform via a Azure devOps pipeline. |
@Red1971 Those are the step I made inside of Synapse, not sure if you can use it in devOps pipeline.
CREATE DATABASE serverless_db;
ALTER DATABASE serverless_db COLLATE SQL_Latin1_General_CP1_CS_AS;
IF NOT EXISTS (SELECT * FROM sys.external_file_formats WHERE name = 'SynapseParquetFormat')
CREATE EXTERNAL FILE FORMAT [SynapseParquetFormat]
WITH ( FORMAT_TYPE = PARQUET)
GO
IF NOT EXISTS (SELECT * FROM sys.external_data_sources WHERE name = 'datasource_name')
CREATE EXTERNAL DATA SOURCE [datasource_name]
WITH (
LOCATION = 'https://yourstorageaccount.blob.core.windows.net/some-container',
)
Go
CREATE OR ALTER VIEW view_name
AS SELECT *,
-- partition data from filepath
view_name_data.filepath(1) AS [customer_id],
view_name_data.filepath(2) AS [year],
view_name_data.filepath(3) AS [month],
view_name_data.filepath(4) AS [version]
FROM
OPENROWSET(
BULK '/customer_id=*/year=*/month=*/version=*/data.parquet',
DATA_SOURCE = 'datasource_name',
FORMAT='PARQUET'
)
WITH(
-- map all columns in data to prevent Synapse from trying to figure out the schema and missing new columns
-- note that this query should be updated and re-run each time you make changes to the schema
component_id VARCHAR(40),
column_1 INT,
column_2 INT,
column_3 DATETIME,
column_4 FLOAT,
column_5 VARCHAR(40)
) AS view_name_data |
Thanks for the reply, I am sure this would work. I ended up using Terraform to create the Synapse Serverless DB. terraform { required_providers { } resource "null_resource" "synapse_create_db" { |
Any updates? We would like to use this feature on a use-case, as we don't want to create the SQL database manually. |
Is there an existing issue for this?
Community Note
Description
I would like to be able to create a Synapse Serverless Database in Synapse with an own resource.
This could be accomplished by sending the SQL command
CREATE DATABASE
to the database engine. See as well: https://docs.microsoft.com/en-us/azure/synapse-analytics/quickstart-serverless-sql-pool#create-databaseI am not firm with SQL Pools but it might be helpful there as well
New or Affected Resource(s)/Data Source(s)
azurerm_synapse_sql_database
Potential Terraform Configuration
No response
References
No response
The text was updated successfully, but these errors were encountered: