From a2b0ba161dd256de7c9117d7d2ad8c3530486511 Mon Sep 17 00:00:00 2001 From: Bill Liang Date: Wed, 17 Feb 2021 13:59:06 -0800 Subject: [PATCH] updated app samples REST API reference --- .../sql-big-data-cluster/app-deploy/README.md | 8 +-- .../app-deploy/RollDice/README.md | 4 +- .../app-deploy/SSIS/README.md | 4 +- .../app-deploy/addpy/README.md | 57 ++----------------- .../app-deploy/magic8ball/README.md | 4 +- .../app-deploy/mleap/README.md | 2 +- .../app-deploy/sentiment-analysis/README.md | 4 +- .../app-deploy/sumofsq/README.md | 4 +- 8 files changed, 19 insertions(+), 68 deletions(-) diff --git a/samples/features/sql-big-data-cluster/app-deploy/README.md b/samples/features/sql-big-data-cluster/app-deploy/README.md index 4c32e423..521be989 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/README.md @@ -1,19 +1,19 @@ # Application deployment on SQL Server big data cluster ## Build more intelligent apps -Application deployment allows you to deploy applications into SQL Server big data cluster as containers. These apps are hosted for you and exposed as Swagger compliant web services for usage in your application. The apps you deploy have access to the data stored in the big data cluster and can be monitored easily. For more information, see [How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions). This page provides a number of samples for different technology stacks. +Application deployment allows you to deploy applications into SQL Server big data cluster as containers. These apps are hosted for you and exposed as Swagger compliant web services for usage in your application. The apps you deploy have access to the data stored in the big data cluster and can be monitored easily. For more information, see [How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps). This page provides a number of samples for different technology stacks. ![Appdeploy](Appdeploy.PNG) ## Pre-requisites * SQL Server big data cluster CTP 2.3 or later -* `azdata` CLI familiarity. If you are unfamiliar with `azdata` please refer to - [App Deployment in SQL Server big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) for more information. +* `azdata` CLI familiarity. If you are unfamiliar with `azdata` please refer to - [App Deployment in SQL Server big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) for more information. * Tip **azdata app -h** will display the various commands to manage the app ## Templates -Templates are used by our [App Deploy add-ins](https://docs.microsoft.com/en-us/sql/big-data-cluster/app-deployment-extension?view=sqlallproducts-allversions) and can be used to quickly deploy applications. +Templates are used by our [App Deploy add-ins](https://docs.microsoft.com/en-us/sql/big-data-cluster/app-deployment-extension) and can be used to quickly deploy applications. > Looking for our templates? See [the SQLBDC-AppDeploy repo](https://github.com/Microsoft/SQLBDC-AppDeploy). ## Available samples @@ -53,4 +53,4 @@ These samples demonstrates how you can deploy a simple R app into SQL Server big ## Related Links For more information, see these articles: -[How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) \ No newline at end of file +[How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-deploy/RollDice/README.md b/samples/features/sql-big-data-cluster/app-deploy/RollDice/README.md index 6df943bd..e598d979 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/RollDice/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/RollDice/README.md @@ -41,7 +41,7 @@ To run this sample, you need the following prerequisites. ## Run this sample 1. Clone or download this sample on your computer. -2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. +2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `azdata` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. ```bash azdata login -e https://:30080 -u -p @@ -119,4 +119,4 @@ output: ## Related Links For more information, see these articles: -[How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) \ No newline at end of file +[How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-deploy/SSIS/README.md b/samples/features/sql-big-data-cluster/app-deploy/SSIS/README.md index 7e155714..f4fa2689 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/SSIS/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/SSIS/README.md @@ -32,7 +32,7 @@ To run this sample, you need the following prerequisites. ## Run this sample 1. Clone or download this sample on your computer. -2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. +2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `azdata` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. ```bash azdata login -e https://:30080 -u @@ -89,4 +89,4 @@ schedule: "*/1 * * * *" ## Related Links For more information, see these articles: -[How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) \ No newline at end of file +[How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-deploy/addpy/README.md b/samples/features/sql-big-data-cluster/app-deploy/addpy/README.md index b0f6fa8d..4a2f5b7e 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/addpy/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/addpy/README.md @@ -35,14 +35,14 @@ To run this sample, you need the following prerequisites. **Software prerequisites:** 1. SQL Server big data cluster CTP 2.3 or later. -2. `azdata`. Refer to [installing azdata](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata?view=sqlallproducts-allversions) document on setting up the `azdata` and connecting to a SQL Server 2019 big data cluster. +2. `azdata`. Refer to [installing azdata](https://docs.microsoft.com/en-us/sql/big-data-cluster/deploy-install-azdata) document on setting up the `azdata` and connecting to a SQL Server 2019 big data cluster. ## Run this sample 1. Clone or download this sample on your computer. -2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. +2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `azdata` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) and then return to this sample. ```bash azdata login -e https://:30080 -u @@ -73,56 +73,7 @@ To run this sample, you need the following prerequisites. "success": true } ``` -6. Any app you create is also accessible using a RESTful web service that is [Swagger](swagger.io) compliant. You can get the endpoint for the web service by running: - ```bash - azdata app describe --name addpy --version [version] - ``` - This will return an output much like the following: - ```json - { - "input_param_defs": [ - { - "name": "x", - "type": "int" - }, - { - "name": "y", - "type": "int" - } - ], - "links": { - "app": "https://[IP]:[PORT]/api/app/addpy/[version]", - "swagger": "https://[IP]:[PORT]/api/app/addpy/[version]/swagger.json" - }, - "name": "addpy", - "output_param_defs": [ - { - "name": "result", - "type": "int" - } - ], - "state": "Ready", - "version": "[version]" - } - ``` - Note the IP address and the port number in this output. Open the following URL in your browser: - `https://[IP]:[PORT]/api/docs/swagger.json`. You will have to log in with the same credentials you used for `azdata login`. The contents of the `swagger.json` you can paste into [Swagger Editor](https://editor.swagger.io) to understand what methods are available: - ![API Swagger](api_swagger.png) - - Notice the `app` GET method as well as the `token` POST method. Since the authentication for apps uses JWT tokens you will need to get a token my using your favorite tool to make a POST call to the `token` method. Here is an example of how to do just that in [Postman](https://www.getpostman.com/): - ![Postman Token](postman_token.png) - - The result of this request will give you an `access_token`, which you will need to call the URL to run the app. - - > *Optional*: If you want, you can open the URL for the `swagger` that was returned when you ran `azdata app describe --name addpy --version [version]` in your browser. You will have to log in with the same credentials you used for `azdata login`. The contents of the `swagger.json` you can paste into [Swagger Editor](https://editor.swagger.io). You will see that the web service exposes the `run` method. - - You can use your favorite tool to call the `run` method (`https://[IP]:30778/api/app/addpy/[version]/run`), passing in the parameters in the body of your POST request as json. In this example we will use [Postman](https://www.getpostman.com/). Before making the call, you will need to set the `Authorization` to `Bearer Token` and paste in the token you retrieved earlier. This will set a header on your request. See the screenshot below. - ![Postman Run Headers](postman_run_1.png) - Next, in the requests body, pass in the parameters to the app you are calling and set the `content-type` to `application/json`: - ![Postman Run Body](postman_run_2.png) - When you send the request, you will get the same output as you did when you ran the app through `azdata app run`: - ![Postman Run Result](postman_result.png) - You have now successfully called the app through the web service! +6. Any app you create is also accessible using a RESTful web service that is [Swagger](swagger.io) compliant. See: [Consume an app deployed on SQL Server Big Data Clusters using a RESTful web service](https://docs.microsoft.com/en-us/sql/big-data-cluster/app-consume). 7. You can clean up the sample by running the following commands: ```bash @@ -159,4 +110,4 @@ output: ## Related Links For more information, see these articles: -[How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) \ No newline at end of file +[How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-deploy/magic8ball/README.md b/samples/features/sql-big-data-cluster/app-deploy/magic8ball/README.md index 3cff9216..186da37b 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/magic8ball/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/magic8ball/README.md @@ -41,7 +41,7 @@ To run this sample, you need the following prerequisites. ## Run this sample 1. Clone or download this sample on your computer. -2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. +2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `azdata` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. ```bash azdata login -e https://:30080 -u @@ -109,4 +109,4 @@ output: ## Related Links For more information, see these articles: -[How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) \ No newline at end of file +[How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-deploy/mleap/README.md b/samples/features/sql-big-data-cluster/app-deploy/mleap/README.md index 4ab1640d..95398bec 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/mleap/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/mleap/README.md @@ -38,7 +38,7 @@ To run this sample, you need the following prerequisites. ## Run this sample 1. Clone or download this sample on your computer. -2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. +2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `azdata` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. ```bash azdata login -e https://:30080 -u diff --git a/samples/features/sql-big-data-cluster/app-deploy/sentiment-analysis/README.md b/samples/features/sql-big-data-cluster/app-deploy/sentiment-analysis/README.md index b548030c..dcd193b6 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/sentiment-analysis/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/sentiment-analysis/README.md @@ -42,7 +42,7 @@ To run this sample, you need the following prerequisites. ## Run this sample 1. Clone or download this sample on your computer. -2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. +2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `azdata` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. ```bash azdata login -e https://:30080 -u @@ -120,4 +120,4 @@ output: ## Related Links For more information, see these articles: -[How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) \ No newline at end of file +[How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) \ No newline at end of file diff --git a/samples/features/sql-big-data-cluster/app-deploy/sumofsq/README.md b/samples/features/sql-big-data-cluster/app-deploy/sumofsq/README.md index b641a7e0..99afeda6 100644 --- a/samples/features/sql-big-data-cluster/app-deploy/sumofsq/README.md +++ b/samples/features/sql-big-data-cluster/app-deploy/sumofsq/README.md @@ -42,7 +42,7 @@ To run this sample, you need the following prerequisites. ## Run this sample 1. Clone or download this sample on your computer. -2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `mssqltctl` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. +2. Log in to the SQL Server big data cluster using the command below using the IP address of the `controller-svc-external` in your cluster. If you are not familiar with `azdata` you can refer to the [documentation](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) and then return to this sample. ```bash azdata login -e https://:30080 -u @@ -111,4 +111,4 @@ output: ## Related Links For more information, see these articles: -[How to deploy and app on SQL Server 2019 big data cluster (preview)](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps?view=sqlallproducts-allversions) \ No newline at end of file +[How to deploy and app on SQL Server 2019 big data cluster](https://docs.microsoft.com/en-us/sql/big-data-cluster/big-data-cluster-create-apps) \ No newline at end of file