Open plooploops opened 2 years ago
Hi, I missed where / how you created the self signed certificate and used this with your docker image.
Thanks!
Updated the flow above (step 2 for using openssl instructions) to account for setting up the self-signed certificate, along with notes around running the docker container and the entrypoint.sh script.
FROM mcr.microsoft.com/mssql/server:2019-latest
USER root
# Install node / npm
RUN apt-get -y update && \
apt-get install -y curl && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs && \
apt-get install -y dos2unix
# Install azurite
RUN npm install -g azurite
# Create app directory
RUN mkdir -p /usr/src/app
RUN mkdir -p /usr/src/app/data
WORKDIR /usr/src/app
# Copy over entrypoint script and ensure it has proper line endings
COPY entrypoint.sh /usr/src/app/
RUN dos2unix *
# Grant permissions
RUN chmod 777 /usr/src/app/entrypoint.sh && \
chmod 777 -R /usr/src/app
# Expose port for SQL
EXPOSE 1433
# Add Azurite Ports
# Blob Storage Port
EXPOSE 10000
# Queue Storage Port
EXPOSE 10001
# Table Storage Port
EXPOSE 10002
USER mssql
ENTRYPOINT /bin/bash ./entrypoint.sh
And entrypoint.sh is:
/opt/mssql/bin/sqlservr & azurite --cert /workspace/cert.pem --key /workspace/key.pem -l /usr/src/app/data --blobHost 0.0.0.0 --queueHost 0.0.0.0 --tableHost 0.0.0.0 --silent --debug debug.log
Are there any updates on this issue? I'm hitting the same error following the same procedure.
Msg 12704, Level 16, State 1, Line 26 Bad or inaccessible location specified in external data source "AzuriteDataSource"
Which service(blob, file, queue, table) does this issue concern?
Blob
Which version of the Azurite was used?
3.17.1
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
npm
What's the Node.js version?
node:
v14.19.1
npm:6.14.16
What problem was encountered?
SQL Bulk Insert isn't working with Azurite: https://docs.microsoft.com/en-us/answers/questions/242043/sql-server-bulk-insert-does-not-work-with-azure-bl.html
Steps to reproduce the issue?
mcr.microsoft.com/mssql/server:2019-latest
as the base image, and install azurite through npm (npm install -g azurite
):Where the contents of entrypoint.sh is:
Use Azure Storage Explorer to connect to Azurite
Create a blob container (e.g. named
containername
) in your Azurite Storage Accountdevstoreaccount1
Upload a CSV file under
devstoreaccount1/containername/path/some.csv
Get a SAS token for your Azurite Blob Container using Azure Storage Explorer
Connect to your SQL container and run the following:
http
)If possible, please provide the debug log using the -d parameter, replacing \<pathtodebuglog> with an appropriate path for your OS, or review the instructions for docker containers:
Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.
Have you found a mitigation/solution?
Workaround: local file loading