This example assumes you have previously completed the following examples:
- Create an Azure Resource Group
- Create an Azure SQL Database
- Install curl
- Open Azure SQL server firewall to your IP address
- Install mssql-cli client
To load the Azure SQL database with data execute the following command lines to connect to the database:
export MSSQL_DNS_NAME=`az sql server show \
--resource-group $RESOURCE_GROUP \
--name $MSSQL_NAME \
--query fullyQualifiedDomainName \
--output tsv`
export MSSQL_CLIENT_USERNAME="$MSSQL_USERNAME@$MSSQL_NAME"
mssql-cli -S $MSSQL_DNS_NAME -U $MSSQL_CLIENT_USERNAME -P $MSSQL_PASSWORD -i create.sql
mssql-cli -S $MSSQL_DNS_NAME -U $MSSQL_CLIENT_USERNAME -P $MSSQL_PASSWORD -d demo -i load.sql
Do NOT forget to remove the resources once you are done running the example.
1m