Skip to content

Commit 36f00e6

Browse files
committed
Release 1.30.0
1 parent aa128db commit 36f00e6

File tree

4 files changed

+63
-29
lines changed

4 files changed

+63
-29
lines changed

README.md

+25-23
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,44 @@ languages:
44
- java
55
products:
66
- azure
7-
- azure-sql-database
8-
description: "Azure SQL sample for managing SQL Database."
9-
urlFragment: sql-database-java-manage-sql-dbs-in-elastic-pool
7+
extensions:
8+
- services: Sql
9+
- platforms: java
1010
---
1111

12-
# Manage Azure SQL Database In Elastic Pool (Java)
12+
# Getting Started with Sql - Manage Sql Database In Elastic Pool - in Java #
1313

14-
Azure SQL sample for managing SQL Database.
1514

16-
- Create a SQL Server with elastic pool and 2 databases
17-
- Create another database and add it to elastic pool through database update
18-
- Create one more database and add it to elastic pool through elastic pool update.
19-
- List and print databases in the elastic pool
20-
- Remove a database from elastic pool.
21-
- List and print elastic pool activities
22-
- List and print elastic pool database activities
23-
- Add another elastic pool in existing SQL Server.
24-
- Delete database, elastic pools and SQL Server
15+
Azure SQL sample for managing SQL Database -
16+
- Create a SQL Server with elastic pool and 2 databases
17+
- Create another database and add it to elastic pool through database update
18+
- Create one more database and add it to elastic pool through elastic pool update.
19+
- List and print databases in the elastic pool
20+
- Remove a database from elastic pool.
21+
- List and print elastic pool activities
22+
- List and print elastic pool database activities
23+
- Add another elastic pool in existing SQL Server.
24+
- Delete database, elastic pools and SQL Server
2525

2626

27-
## Running this sample
27+
## Running this Sample ##
2828

2929
To run this sample:
3030

3131
Set the environment variable `AZURE_AUTH_LOCATION` with the full path for an auth file. See [how to create an auth file](https://github.com/Azure/azure-libraries-for-java/blob/master/AUTH.md).
3232

33-
```bash
34-
git clone https://github.com/Azure-Samples/sql-database-java-manage-sql-dbs-in-elastic-pool.git
35-
cd sql-database-java-manage-sql-dbs-in-elastic-pool
36-
mvn clean compile exec:java
37-
```
33+
git clone https://github.com/Azure-Samples/sql-database-java-manage-sql-dbs-in-elastic-pool.git
3834

39-
## More information
35+
cd sql-database-java-manage-sql-dbs-in-elastic-pool
36+
37+
mvn clean compile exec:java
38+
39+
## More information ##
4040

4141
[http://azure.com/java](http://azure.com/java)
4242

43-
If you don't have a Microsoft Azure subscription you can get a FREE trial account [here](http://go.microsoft.com/fwlink/?LinkId=330212).
43+
If you don't have a Microsoft Azure subscription you can get a FREE trial account [here](http://go.microsoft.com/fwlink/?LinkId=330212)
44+
45+
---
4446

45-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
47+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

pom.xml

+11-1
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,22 @@
5353
<dependency>
5454
<groupId>com.microsoft.azure</groupId>
5555
<artifactId>azure</artifactId>
56-
<version>1.24.1</version>
56+
<version>1.30.0</version>
5757
</dependency>
5858
<dependency>
5959
<groupId>commons-net</groupId>
6060
<artifactId>commons-net</artifactId>
6161
<version>3.3</version>
6262
</dependency>
63+
<dependency>
64+
<groupId>commons-lang</groupId>
65+
<artifactId>commons-lang</artifactId>
66+
<version>2.6</version>
67+
</dependency>
68+
<dependency>
69+
<groupId>org.apache.commons</groupId>
70+
<artifactId>commons-lang3</artifactId>
71+
<version>3.7</version>
72+
</dependency>
6373
</dependencies>
6474
</project>

src/main/java/com/microsoft/azure/management/samples/Utils.java

+20-1
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,24 @@ public static void print(LoadBalancer resource) {
739739
}
740740
}
741741

742+
// Show HTTPS probes
743+
info.append("\n\tHTTPS probes: ")
744+
.append(resource.httpsProbes().size());
745+
for (LoadBalancerHttpProbe probe : resource.httpsProbes().values()) {
746+
info.append("\n\t\tProbe name: ").append(probe.name())
747+
.append("\n\t\t\tPort: ").append(probe.port())
748+
.append("\n\t\t\tInterval in seconds: ").append(probe.intervalInSeconds())
749+
.append("\n\t\t\tRetries before unhealthy: ").append(probe.numberOfProbes())
750+
.append("\n\t\t\tHTTPS request path: ").append(probe.requestPath());
751+
752+
// Show associated load balancing rules
753+
info.append("\n\t\t\tReferenced from load balancing rules: ")
754+
.append(probe.loadBalancingRules().size());
755+
for (LoadBalancingRule rule : probe.loadBalancingRules().values()) {
756+
info.append("\n\t\t\t\tName: ").append(rule.name());
757+
}
758+
}
759+
742760
// Show load balancing rules
743761
info.append("\n\tLoad balancing rules: ")
744762
.append(resource.loadBalancingRules().size());
@@ -994,7 +1012,7 @@ public static void print(AppServicePlan resource) {
9941012
*/
9951013
public static void print(WebAppBase resource) {
9961014
StringBuilder builder = new StringBuilder().append("Web app: ").append(resource.id())
997-
.append("Name: ").append(resource.name())
1015+
.append("\n\tName: ").append(resource.name())
9981016
.append("\n\tState: ").append(resource.state())
9991017
.append("\n\tResource group: ").append(resource.resourceGroupName())
10001018
.append("\n\tRegion: ").append(resource.region())
@@ -1377,6 +1395,7 @@ public static String createRandomName(String namePrefix) {
13771395
*/
13781396
public static void createCertificate(String certPath, String pfxPath,
13791397
String alias, String password, String cnName) throws Exception {
1398+
SdkContext.prepareFileLocation(new File(pfxPath), new File(certPath));
13801399
if (new File(pfxPath).exists()) {
13811400
return;
13821401
}

src/main/java/com/microsoft/azure/management/sql/samples/ManageSqlDatabaseInElasticPool.java

+7-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@
1212
import com.microsoft.azure.management.Azure;
1313
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
1414
import com.microsoft.azure.management.samples.Utils;
15-
import com.microsoft.azure.management.sql.DatabaseEditions;
15+
import com.microsoft.azure.management.sql.DatabaseEdition;
1616
import com.microsoft.azure.management.sql.ElasticPoolActivity;
1717
import com.microsoft.azure.management.sql.ElasticPoolDatabaseActivity;
18-
import com.microsoft.azure.management.sql.ElasticPoolEditions;
18+
import com.microsoft.azure.management.sql.ElasticPoolEdition;
19+
import com.microsoft.azure.management.sql.ServiceObjectiveName;
1920
import com.microsoft.azure.management.sql.SqlDatabase;
2021
import com.microsoft.azure.management.sql.SqlElasticPool;
2122
import com.microsoft.azure.management.sql.SqlServer;
@@ -56,7 +57,7 @@ public static boolean runSample(Azure azure) {
5657
final String database1Name = "myDatabase1";
5758
final String database2Name = "myDatabase2";
5859
final String anotherDatabaseName = "myAnotherDatabase";
59-
final ElasticPoolEditions elasticPoolEdition = ElasticPoolEditions.STANDARD;
60+
final ElasticPoolEdition elasticPoolEdition = ElasticPoolEdition.STANDARD;
6061

6162
try {
6263
// ============================================================
@@ -145,7 +146,9 @@ public static boolean runSample(Azure azure) {
145146
System.out.println("Remove the database from the pool.");
146147
anotherDatabase = anotherDatabase.update()
147148
.withoutElasticPool()
148-
.withEdition(DatabaseEditions.STANDARD)
149+
.withEdition(DatabaseEdition.STANDARD)
150+
.withServiceObjective(ServiceObjectiveName.S3)
151+
.withMaxSizeBytes(1024 * 1024 * 1024 * 20)
149152
.apply();
150153
Utils.print(anotherDatabase);
151154

0 commit comments

Comments
 (0)