Upload files to MS SQL

Overview

On the MS SQL DBMS managed and DBA mode services the access to local disks is not allowed. Therefore the only way to access files from the SQL Server is to place them on a remote share on a VM member of the same resource domain as the SQL server, granting the appropriate rights to the SQL service account.

The upload files action eliminates the need of creating shares on other VM's, enabling the direct upload of certain files type to the SQL system.

The file transfer is done using an S3 bucket analogous to the Import DB functionality.

Target services

The feature will be available for Managed DBMS, Managed DBMS DBA mode and Managed SQL AlwaysOn. The table below illustrate which actions are possible depending on the service type. The differences in the purpose are due to the permissions set on the DBMS.

In DBA mode it is possible to enable xp_cmdshell and CLR as customers are sysadmin. This grant the capability to access files from the underlying file system or to load CLR assemblies.

ServicePurposeSSMS/JobsPortal
Managed MS SQL Server xxxxBulk insertXO
Managed MS SQL Server xxxxLoad assemblies, Load certificateOX
Managed MS SQL Server xxxxExecute SQL scriptsXO
Managed MS SQL DBMS xxxx DBA modeBulk insertXO
Managed MS SQL DBMS xxxx DBA modeLoad assemblies, Load certificateXX
Managed MS SQL DBMS xxxx DBA modeExecute SQL scriptsXO

X = available

O = not available

The SQL AlwaysOn service is handled as the Managed MS SQL Server xxxx.

File types

The file types are restricted to the most commonly used in SQL.

The table below indicates which files are allowed on the a specific service type.

TypeExtensionPurposeManagedDBA Mode
.xmlXMLBulk insertXX
.fmtFormat fileBulk insertXX
.txtTextBulk insertXX
.csvComma separated valueBulk insertXX
.sqlT-SQL scriptSQL executionXX
.dllLibraryCLR UploadXX
.cerSQL CertificateSQL certificate backupXX
.keySQL KeySQL Key backupOX

X = allowed

O = not allowed

For SQL certificates and keys there is not specific file extensions. In order to identify the files add _.cer and _.key as extensions for certificate and keys.

Upload repository

The files will be uploaded to this specific folder on the target system: D:\FileRepository. The repository folder cannot be changed.

The upload action includes an option to clean up the repository, i.e. delete the existing files and folders. If you don't want to clean up the repository the new files will be added, however files with the same name will be overwritten.

The child folder structure will correspond to the folder structure which is defined in the S3 bucket.

Restriction enforcement

Files which don't belong to the type listed above will be deleted as well as files without extensions.

A file rename in the repository is not possible.

Last Updated: