<commit_before># mssql-restapi

This is a *prototype* of a simple [ASP.NET Core 2.0](https://docs.microsoft.com/en-us/aspnet/core/getting-started) Web API app that uses [SQL Server Management Objects (SMO)](https://www.nuget.org/packages/Microsoft.SqlServer.SqlManagementObjects) under the covers to provide a RESTful interface for SQL Server running anywhere.

Demo walkthrough + source code at: <https://github.com/sanagama/mssql-restapi>

## Run locally

Type the commands below in a ```Terminal``` window to run this prototype in Docker. Use environment variables to specify the connection to your SQL Server instance.

>*TIP:* Replace *server*, *username* and *password* in the example below as appropriate for your SQL Server instance or Azure SQL Database.

```
docker pull sanagama/mssql-restapi

MSSQL_HOST="<server>" \
MSSQL_PORT="1433" \
MSSQL_USERNAME="<username>" \
MSSQL_PASSWORD="<password>" \
docker run -it --name 'mssql-restapi' -p 5000:5000 sanagama/mssql-restapi
```

## Run in Azure Web App on Linux
To use this Docker image in Azure Web App on Linux, see: <https://docs.microsoft.com/en-us/azure/app-service-web/app-service-linux-using-custom-docker-image><commit_msg>formatting<commit_after># mssql-restapi

This is a *prototype* of a simple [ASP.NET Core 2.0](https://docs.microsoft.com/en-us/aspnet/core/getting-started) Web API app that uses [SQL Server Management Objects (SMO)](https://www.nuget.org/packages/Microsoft.SqlServer.SqlManagementObjects) under the covers to provide a RESTful interface for SQL Server running anywhere.

Demo walkthrough + source code at: <https://github.com/sanagama/mssql-restapi>

### Run locally

Type the commands below in a ```Terminal``` window to run this prototype in Docker. Use environment variables to specify the connection to your SQL Server instance.

>*TIP:* Replace *server*, *username* and *password* in the example below as appropriate for your SQL Server instance or Azure SQL Database.

```
docker pull sanagama/mssql-restapi

MSSQL_HOST="<server>" \
MSSQL_PORT="1433" \
MSSQL_USERNAME="<username>" \
MSSQL_PASSWORD="<password>" \
docker run -it --name 'mssql-restapi' -p 5000:5000 sanagama/mssql-restapi
```

### Run in Azure Web App on Linux

To use this Docker image in Azure Web App on Linux, see: <https://docs.microsoft.com/en-us/azure/app-service-web/app-service-linux-using-custom-docker-image>
{'fraction_non_alphanumeric': 0.11596638655462185, 'fraction_numerical': 0.011764705882352941, 'mean_word_length': 4.864532019704433, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 15, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6369210', 'n_tokens_mistral': 778, 'n_tokens_neox': 715, 'n_words': 249}