Permalink
Browse files

Update README.md

  • Loading branch information...
1 parent 2b04741 commit 23efcc24d7e543eb14aa5b4994a21b39929ba823 @glennblock glennblock committed Feb 12, 2013
Showing with 29 additions and 2 deletions.
  1. +29 −2 README.md
View
@@ -324,12 +324,39 @@ azure.RoleEnvironment.getRoles(function(error, roles) {
The Azure SQL Database functions allow you to manage Azure SQL servers, databases and firewall rules.
-### Servers
+### Servers and Firewall Rules
To work with servers and firewall rules you can use the SqlManagementService
+*Servers*
```Javascript
var authentication={keyvalue:"...", certvalue:"..."};
var sqlMgmt = new azure.SqlManagementService(subscriptionId, authentication);
+
+//create a new server
+//admin, password, location, callback
+sqlMgmt.createServer("sqladmin", "pa$$w0rd", "West US", function(error, serverName) {
+ console.log("created server " + serverName);
+});
+
+//list out servers
+sqlMgmt.listServers(function(error, servers) {
+ console.log("servers\n" + servers);
+});
+
+```
+
+*Firewall rules*
+```Javascript
+var authentication={keyvalue:"...", certvalue:"..."};
+var sqlMgmt = new azure.SqlManagementService(subscriptionId, authentication);
+
+//create a new rule
+//server, rule name, start ip, end ip, callback
+sqlMgmt.createServerFirewallRule(serverName, "myrule", "192.168.100.0", "192.168.100.255",
+ function(error, firewallRule) {
+ console.log("Rule created:\n" + firewallRule);
+ }
+);
```
**For more examples please see the [Windows Azure Node.js Developer Center](http://www.windowsazure.com/en-us/develop/nodejs)**
@@ -350,4 +377,4 @@ For documentation on how to host Node.js applications on Windows Azure, please s
For documentation on the Azure cross platform CLI tool for Mac and Linux, please see our readme [here] (http://github.com/windowsazure/azure-sdk-tools-xplat)
-Check out our new IRC channel on freenode, node-azure.
+Check out our new IRC channel on freenode, node-azure.

0 comments on commit 23efcc2

Please sign in to comment.