1 Introduction
Hello, Readers!
While exporting data to Azure Blob Storage using SQL Server Integration Services (SSIS), I encountered the “Unable to create Azure container” error. This article will guide you through a straightforward solution, aiming to save you time and prevent similar frustrations in the future.
2 Context
The logic of the example is quite simple and consists of two main steps:
- Extract data from a local database
- Export the extracted data as a text file to Azure Blob Storage
The prerequisites for this process include:
2.1 Azure Storage
For this example, an Azure Storage Account and a Blob Storage Container were created to store the exported data.
2.2 Local Database
The data source for this export is the Product table in the SalesLT schema of the AdventureWorksLT2022 database, a sample provided by Microsoft. You can access it here.
The structure of table Product is described in the following picture:
2.3 IDE
The development environment is Visual Studio 2022, with the SQL Server Integration Services Projects 2022 extension installed.
3 Problem Statement
The goal is to export the following fields from the Product table to a CSV file in Azure Blob Storage: ProductNumber, Name, Color, StandardCost, ListPrice, Size, Weight, and SellStartDate. Here’s a breakdown of the steps I followed:
3.1 Data Flow Creation
I created a Data Flow task with:
- OLE DB Source for reading data from SQL Server.
- Azure Blob Destination for exporting the data to Azure Blob Storage.
3.2 OLE DB Source Settings
To simplify the process:
- A SQL query was used in the SSIS SQL Command Text instead of a stored procedure (as recommended by best practices), avoiding any updates to the AdventureWorksLT2022 database.
- The SellStartDate formatting was handled within the SQL query, eliminating the need for a Derived Column transformation.
Connection Manager settings
OLE DB Source settings
3.3 Azure Blob Destination Settings
The Azure Storage Connection Manager was configured with the necessary access credentials, enabling data export to Azure Blob Storage.
Azure Storage Connection Manager settings
(Azure storage details are retrieve from Azure as shown below)
Azure Blob Storage Destination settings
3.4 Complete flow
After setting up both components, the Data Flow was ready for execution, as shown in the final configuration image.
3.5 Execution
Upon execution, the package fails with the error: “Unable to create Azure Blob container“
Error details are shown in the following pictures:
4 Root Cause Analysis
This error is often due to an issue with Transport Layer Security (TLS). Azure Blob Storage requires connections to use TLS version 1.2. However, the default configuration for the Azure Feature Pack in SSIS may not enforce TLS 1.2, as it depends on the .NET Framework settings on the system.
5 Solution
To resolve this, the system’s .NET Framework settings must be modified to enforce TLS 1.2. This can be done by adding a REG_DWORD value named SchUseStrongCrypto with a value of 1 under the following registry keys:
Registry key creation
Final values after key creation
This registry update forces .NET to use TLS 1.2 for secure connections, satisfying Azure’s requirement.
After applying this update, I reran the SSIS package, which completed successfully.
The Products.csv file was created and uploaded to the Azure Blob Container as expected.
The content of file Products.csv is shown in the below picture
6 Conclusion
For seamless SSIS integration with Azure Blob Storage, ensure that your system enforces TLS 1.2 by updating the .NET Framework registry settings. This resolves the “Unable to create Azure Blob container” error, facilitating successful data export to Azure Blob Storage.
Stay tuned for further insights in upcoming posts!