| page_type | languages | products | description | urlFragment | |||
|---|---|---|---|---|---|---|---|
sample |
|
|
These code samples will show you how to manage SQL using Azure SDK for JavaScript/TypeScript. |
SQL |
These code samples will show you how to manage SQL using Azure SDK for JavaScript/TypeScript.
- Using the Azure SDK for JavaScript/TypeScript - SQL Management Library @azure/arm-sql for the Azure SQL API
-
Before using the sdk package,we need install nodejs and add it into environment variables.
reference :
nodejs version: 14.16.0 typescript version: 4.1.3
-
Clone the repository.
git clone https://github.com/Azure-Samples/azure-samples-js-management -
Install the dependencies using npm.
cd azure-samples-js-management/samples/links npm i -g typescript npm install
A demo app is included to show how to use the project.
To run the complete demo, you need to call the methods you want to test in this main method.
```
async function main() {
client = new SqlManagementClient(credential, subscriptionId);
storage_client = new StorageManagementClient(credential,subscriptionId);
await servers_beginCreateOrUpdateAndWait();
}
```
execute below command on terminal
```
tsc sql_database_examples.ts (it will create a same name js file)
node sql_database_examples.js
```