Skip to content

Commit

Permalink
added sql examples
Browse files Browse the repository at this point in the history
  • Loading branch information
selvasingh committed Dec 19, 2016
1 parent afd204c commit a05d202
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,27 @@ WebApp webApp = azure.webApps()

**Create a SQL Database**

You can create a SQL database instance by using another `define() … create()` method chain.
You can create a SQL server instance by using another `define() … create()` method chain.

```java
SqlServer sqlServer = azure.sqlServers().define(sqlServerName)
.withRegion(Region.US_EAST)
.withNewResourceGroup(rgName)
.withAdministratorLogin("adminlogin123")
.withAdministratorPassword("myS3cureP@ssword")
.withNewFirewallRule("10.0.0.1")
.withNewFirewallRule("10.2.0.1", "10.2.0.10")
.create();
```

Then, you can create a SQL database instance by using another `define() … create()` method chain.

```java
SqlDatabase database = sqlServer.databases().define("myNewDatabase")
.withoutElasticPool()
.withoutSourceDatabaseId()
.withEdition(DatabaseEditions.BASIC)
.create();
```

#Sample Code
Expand Down

0 comments on commit a05d202

Please sign in to comment.