diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000000..c5f3f6b9c75
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "java.configuration.updateBuildConfiguration": "interactive"
+}
\ No newline at end of file
diff --git a/azure-mgmt-network/.factorypath b/azure-mgmt-network/.factorypath
index 6656fa935d3..8f942e3d53e 100644
--- a/azure-mgmt-network/.factorypath
+++ b/azure-mgmt-network/.factorypath
@@ -1,4 +1,22 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/azure-samples/pom.xml b/azure-samples/pom.xml
index 2a359c4bd3c..4917faf1b85 100644
--- a/azure-samples/pom.xml
+++ b/azure-samples/pom.xml
@@ -1,4 +1,3 @@
-
4.0.0
-
- com.microsoft.azure
- azure-parent
- 1.23.1-SNAPSHOT
- ../pom.xml
-
-
- azure-samples
- 1.23.1-SNAPSHOT
-
- Microsoft Azure SDK samples
- This package contains Microsoft Azure SDK samples.
+ com.microsoft.azure
+ 1.26.1-SNAPSHOT
+ azure-parent
+ pom
+
+ Microsoft Azure SDK Parent
+ This package contains the parent module of Microsoft Azure SDK.
https://github.com/Azure/azure-sdk-for-java
-
+
-
- The MIT License (MIT)
- http://opensource.org/licenses/MIT
- repo
-
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
-
+
- scm:git:https://github.com/Azure/azure-sdk-for-java
- scm:git:git@github.com:Azure/azure-sdk-for-java.git
- HEAD
+ scm:git:https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
-
+
- UTF-8
-
+ UTF-8
+
+ playback
+ 11080
-
+
-
- microsoft
- Microsoft
-
+
+ microsoft
+ Microsoft
+
-
-
+
+
+
+ ossrh
+ Sonatype Snapshots
+ https://oss.sonatype.org/content/repositories/snapshots/
+ true
+ default
+
+
+
+
+
- com.microsoft.azure
- azure-servicebus
- 0.9.7
-
-
- javax.ws.rs
- jsr311-api
-
-
- org.apache.httpcomponents
- httpclient
-
-
-
-
- com.microsoft.azure
- azure
- 1.23.1-SNAPSHOT
-
-
- com.microsoft.azure
- azure-mgmt-resources
- 1.23.1-SNAPSHOT
-
-
- com.microsoft.azure
- azure-mgmt-storage
- 1.23.1-SNAPSHOT
-
-
- com.microsoft.azure
- azure-mgmt-network
- 1.23.1-SNAPSHOT
-
-
- com.microsoft.azure
- azure-mgmt-compute
- 1.23.1-SNAPSHOT
-
-
- com.microsoft.azure
- azure-mgmt-appservice
- 1.23.1-SNAPSHOT
-
-
- com.microsoft.azure
- azure-mgmt-cosmosdb
- 1.23.1-SNAPSHOT
-
-
- org.slf4j
- slf4j-simple
- 1.7.21
-
-
- commons-net
- commons-net
- 3.3
+ com.fasterxml.jackson.core
+ jackson-core
+ 2.9.4
- org.eclipse.jgit
- org.eclipse.jgit
- 4.5.0.201609210915-r
+ com.fasterxml.jackson.core
+ jackson-databind
+ 2.9.4
- commons-lang
- commons-lang
- 2.6
+ com.fasterxml.jackson.core
+ jackson-annotations
+ 2.9.0
- org.apache.commons
- commons-lang3
- 3.7
+ commons-codec
+ commons-codec
+ 1.10
- com.microsoft.azure
- azure-storage
+ io.reactivex
+ rxjava
+ 1.3.8
- com.fasterxml.jackson.core
- jackson-core
+ com.microsoft.azure
+ azure-client-runtime
+ 1.6.12
- com.microsoft.azure
- azure-keyvault
- 1.0.0
+ com.microsoft.azure
+ azure-client-authentication
+ 1.6.12
- com.jcraft
- jsch
- 0.1.53
+ com.google.guava
+ guava
+ 20.0
- com.github.cverges.expect4j
- expect4j
- 1.6
-
-
- com.microsoft.azure
- azure-mgmt-resources
- 1.23.1-SNAPSHOT
- test-jar
- test
+ com.microsoft.azure
+ azure-keyvault
+ 1.0.0
- commons-io
- commons-io
- test
+ com.microsoft.azure
+ azure-storage
+ 6.1.0
+
- junit
- junit
- test
+ junit
+ junit
+ 4.12
+ test
- com.github.docker-java
- docker-java
- 3.0.6
+ commons-io
+ commons-io
+ 2.4
+ test
- io.fabric8
- kubernetes-client
- 4.3.0
+ com.microsoft.azure
+ azure-annotations
+ 1.9.0
- com.microsoft.azure
- azure-documentdb
- 1.9.4
+ org.slf4j
+ slf4j-simple
+ 1.7.5
+ test
- com.spotify
- docker-client
- 8.9.0
+ org.eclipse.jgit
+ org.eclipse.jgit
+ 4.5.0.201609210915-r
+
+
+ org.apache.httpcomponents
+ httpclient
+
+
- com.microsoft.sqlserver
- mssql-jdbc
- 6.4.0.jre7
+ commons-net
+ commons-net
+ 3.3
- com.microsoft.azure
- azure-eventhubs
- 1.0.0
+ javax.xml.bind
+ jaxb-api
+ 2.3.0
-
+
+
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.0
-
-
-
- com.microsoft.azure.management.apigeneration.LangDefinitionProcessor
-
- true
- true
-
- true
- true
-
+
+
+ org.eclipse.jetty
+ jetty-maven-plugin
+ 9.2.22.v20170606
+
+ 0
+ 11079
+ STOP
+ false
+ ${project.basedir}/jetty.xml
+
+
+
+ org.codehaus.mojo
+ properties-maven-plugin
+ 1.0.0
+
+
+ generate-resources
+
+ write-project-properties
+
+
+
+ ${project.build.outputDirectory}/maven.properties
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-checkstyle-plugin
+ 2.17
+
+
+ com.microsoft.azure
+ autorest-build-tools
+ [1.0.0,2.0.0)
+
+
+ com.puppycrawl.tools
+ checkstyle
+ 6.18
+
+
+
+ checkstyle.xml
+ samedir=runtimes/build-tools/src/main/resources
+ suppressions.xml
+ true
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.1
+
+ 1.7
+ 1.7
+ true
+ true
+ -Xlint:unchecked
+
+
+
+
+ org.apache.maven.plugins
+ maven-javadoc-plugin
+ 3.0.0
+
+ Microsoft Azure Management Libraries for Java ${project.version}
+ Microsoft Azure Management Libraries for Java ${project.version}
+ -Xdoclint:none
+ *.samples;*.implementation.*;*.utils.*;com.microsoft.azure.utility;*.management.billing;*.management.cognitiveservices;*.management.consumption;*.management.customerinsights;*.management.devices;*.management.devtestlab;*.management.insights;*.management.logic;*.management.machinelearning;*.management.notificationhubs;*.management.powerbi;*.management.recoveryservices;*.management.relay;*.management.scheduler;*.management.servicefabric;*.management.streamanalytics
+ /**
+
* Copyright (c) Microsoft Corporation. All rights reserved.
+
* Licensed under the MIT License. See License.txt in the project root for
+
* license information.
+
*/]]>
+
+
+
+
+ org.apache.maven.plugins
+ maven-release-plugin
+ 2.5.3
+
+
+
+ com.googlecode.addjars-maven-plugin
+ addjars-maven-plugin
+ 1.0.5
+
+
+
+ add-jars
+
+
+
+
+ ../extlib
+
+
-
+
+
+
+
+
+
+
+
+ com.github.spotbugs
+ spotbugs-maven-plugin
+ 3.1.1
+
+ ${project.parent.basedir}/spotbugs-includeFilter.xml
+ ${project.parent.basedir}/spotbugs-excludeFilter.xml
+
+
+
+
+ com.github.spotbugs
+ spotbugs
+ 3.1.1
+
+
+
+
+ org.apache.maven.plugins
+ maven-resources-plugin
+ 2.4.3
+
+
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ 2.18.1
+
+ false
+ false
+
+ **/Test*.java
+ **/*Test.java
+ **/*Tests.java
+ **/*TestCase.java
+
+
+ ${testMode}
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-release-plugin
+ 2.5.2
+
+
+
+ org.eclipse.m2e
+ lifecycle-mapping
+ 1.0.0
+
+
+
+
+
+
+ com.googlecode.addjars-maven-plugin
+
+
+ addjars-maven-plugin
+
+ [1.0.5,)
+
+ add-jars
+
+
+
+
+
+
+
+
+
+
+
+
+ maven-clean-plugin
+ 3.0.0
+
+
+
+ .
+
+ serial.output
+
+
+
+
+
+
+
-
+
+
+ run-shade-plugin
+
+ runShadePlugin
+
+
+
+
+ org.apache.maven.plugins
+ maven-shade-plugin
+ 2.4.1
+
+
+
+
+ shade-plugin
+ package
+
+ shade
+
+
+
+
+ *:*
+
+ META-INF/*.SF
+ META-INF/*.DSA
+ META-INF/*.RSA
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ./azure
+ ./azure-samples
+ ./azure-mgmt-appservice
+ ./azure-mgmt-batch
+ ./azure-mgmt-batchai
+ ./azure-mgmt-cdn
+ ./azure-mgmt-compute
+ ./azure-mgmt-containerinstance
+ ./azure-mgmt-containerregistry
+ ./azure-mgmt-containerservice
+ ./azure-mgmt-cosmosdb
+ ./azure-mgmt-datalake-analytics
+ ./azure-mgmt-datalake-store
+ ./azure-mgmt-dns
+ ./azure-mgmt-eventhub
+ ./azure-mgmt-graph-rbac
+ ./azure-mgmt-keyvault
+ ./azure-mgmt-locks
+ ./azure-mgmt-monitor
+ ./azure-mgmt-network
+ ./azure-mgmt-redis
+ ./azure-mgmt-resources
+ ./azure-mgmt-search
+ ./azure-mgmt-servicebus
+ ./azure-mgmt-sql
+ ./azure-mgmt-storage
+ ./azure-mgmt-trafficmanager
+ ./azure-mgmt-msi
+
+
\ No newline at end of file
diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageAppGwV2kv.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageAppGwV2kv.java
new file mode 100644
index 00000000000..178d2284d5f
--- /dev/null
+++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManageAppGwV2kv.java
@@ -0,0 +1,192 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.network.samples;
+
+import com.microsoft.azure.credentials.ApplicationTokenCredentials;
+import com.microsoft.azure.management.Azure;
+import com.microsoft.azure.management.network.ApplicationGateway;
+import com.microsoft.azure.management.network.ApplicationGatewaySkuName;
+import com.microsoft.azure.management.network.ApplicationGatewayTier;
+import com.microsoft.azure.management.network.Network;
+import com.microsoft.azure.management.network.Subnet;
+import com.microsoft.azure.management.network.PublicIPAddress;
+import com.microsoft.azure.management.network.PublicIPSkuType;
+import com.microsoft.azure.management.network.ManagedServiceIdentity;
+import com.microsoft.azure.management.network.ResourceIdentityType;
+import com.microsoft.azure.management.network.ManagedServiceIdentityUserAssignedIdentitiesValue;
+import com.microsoft.azure.management.keyvault.Vault;
+import com.microsoft.azure.management.keyvault.Secret;
+import com.microsoft.azure.management.keyvault.implementation.KeyVaultManager;
+import com.microsoft.azure.management.msi.Identity;
+import com.microsoft.azure.management.msi.implementation.MSIManager;
+import com.microsoft.azure.management.resources.fluentcore.arm.Region;
+import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext;
+import com.microsoft.azure.SubResource;
+import com.microsoft.rest.LogLevel;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.HashMap;
+import com.google.gson.JsonObject;
+import com.google.common.io.Files;
+import java.nio.charset.Charset;
+
+/**
+ * Azure Network sample for managing private DNS -
+ * - Create a private DNS zone
+ * - Update a virtual network.
+ * */
+
+public final class ManageAppGwV2kv {
+ /**
+ * Main function which runs the actual sample.
+ * @param azure instance of the azure client
+ * @return true if sample runs successfully
+ */
+
+ final static Region region = Region.US_WEST2;
+ final static String rgName = SdkContext.randomResourceName("rg", 24);
+ final static String nwName = SdkContext.randomResourceName("nw", 24);
+ final static String identityName = SdkContext.randomResourceName("id", 10);
+ final static String sbName = "subnetappgw";
+ final static String pipName = "pipAppGW";
+ final strauc String certificateName = "test.certificate";
+
+ public static boolean runSample(Azure azure, ApplicationTokenCredentials cred) {
+ try {
+ ManageAppGwV2kv appgw = ManageAppGwV2kv();
+ Network network = azure.networks().define(nwName)
+ .withRegion(region)
+ .withNewResourceGroup(rgName)
+ .withAddressSpace("10.0.0.0/27")
+ .withSubnet(sbName, "10.0.0.0/27")
+ .create();
+ PublicIPAddress pipAppGw = azure.publicIPAddresses().define(pipName)
+ .withRegion(region)
+ .withExistingResourceGroup(rgName)
+ .withSku(PublicIPSkuType.STANDARD)
+ .create();
+ MSIManager msiManager = MSIManager
+ .authenticate(cred, cred.defaultSubscriptionId());
+ KeyVaultManager keyVaultManager = KeyVaultManager.authenticate(cred, cred.defaultSubscriptionId());
+ Identity identity = msiManager.identities()
+ .define(identityName)
+ .withRegion(region)
+ .withExistingResourceGroup(rgName)
+ .create();
+ KeyVaultManager keyVaultManager = KeyVaultManager.authenticate(cred, cred.defaultSubscriptionId());
+ Secret secret1 = appgw.createKeyVaultSecret(cred.clientId(), identity.principalId(), keyVaultManager, rgName);
+ ApplicationGateway gw1 = azure.applicationGateways().define(appGwName)
+ .withRegion(region)
+ .withExistingResourceGroup(rgName)
+ .defineRequestRoutingRule("rule1")
+ .fromPublicFrontend()
+ .fromFrontendHttpsPort(443)
+ .withSslCertificate("ssl1")
+ .toBackendHttpPort(80)
+ .toBackendIPAddress("192.168.22.4")
+ .toBackendIPAddress("192.168.22.5")
+ .attach()
+ .withIdentity(serviceIdentity)
+ .defineSslCertificate("ssl1")
+ .withKeyVaultSecretId(secret1.id())
+ .attach()
+ .withExistingSubnet(subnetVnet)
+ .withSize(ApplicationGatewaySkuName.STANDARD_V2)
+ .withTier(ApplicationGatewayTier.STANDARD_V2)
+ .withExistingPublicIPAddress(pipAppGw)
+ .create();
+ return true;
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ } finally {
+ try {
+ System.out.println("Deleting Resource Group: " + rgName);
+ azure.resourceGroups().beginDeleteByName(rgName);
+ } catch (NullPointerException npe) {
+ System.out.println("Did not create any resources in Azure. No clean up is necessary");
+ } catch (Exception g) {
+ g.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+ public static void main(String[] args) {
+ try {
+ //=============================================================
+ // Authenticate
+
+ final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
+ final ApplicationTokenCredentials cred = ApplicationTokenCredentials.fromFile(credFile);
+
+ Azure azure = Azure.configure()
+ .withLogLevel(LogLevel.BODY)
+ .authenticate(credFile)
+ .withDefaultSubscription();
+
+ runSample(azure, cred);
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ private ManageAppGwV2kv() {
+ }
+
+ private static ManagedServiceIdentity createManagedServiceIdentityFromIdentity(Identity identity) throws Exception{
+ JsonObject userAssignedIdentitiesValueObject = new JsonObject();
+ userAssignedIdentitiesValueObject.addProperty("principalId", identity.principalId());
+ userAssignedIdentitiesValueObject.addProperty("clientId", identity.clientId());
+ ManagedServiceIdentityUserAssignedIdentitiesValue userAssignedIdentitiesValue =
+ new JacksonAdapter().deserialize(userAssignedIdentitiesValueObject.toString(),
+ ManagedServiceIdentityUserAssignedIdentitiesValue.class);
+ Map userAssignedIdentities =
+ new HashMap();
+ userAssignedIdentities.put(identity.id(), userAssignedIdentitiesValue);
+ ManagedServiceIdentity serviceIdentity = new ManagedServiceIdentity();
+ serviceIdentity.withType(ResourceIdentityType.USER_ASSIGNED);
+ serviceIdentity.withUserAssignedIdentities(userAssignedIdentities);
+ return serviceIdentity;
+ }
+
+ private Secret createKeyVaultSecret(String servicePrincipal, String identityPrincipal, KeyVaultManager keyVaultManager, String rgName) throws Exception {
+ String vaultName = SdkContext.randomResourceName("vlt", 10);
+ String secretName = SdkContext.randomResourceName("srt", 10);
+ String secretValue = Files.readFirstLine(new File(getClass().getClassLoader()
+ .getResource(certificateName).getFile()),
+ Charset.defaultCharset());
+ Vault vault = keyVaultManager.vaults()
+ .define(vaultName)
+ .withRegion(Region.US_WEST2.name())
+ .withExistingResourceGroup(rgName)
+ .defineAccessPolicy()
+ .forServicePrincipal(servicePrincipal)
+ .allowSecretAllPermissions()
+ .attach()
+ .defineAccessPolicy()
+ .forObjectId(identityPrincipal)
+ .allowSecretAllPermissions()
+ .attach()
+ .withAccessFromAzureServices()
+ .withDeploymentEnabled()
+ // Important!! Only soft delete enabled key vault can be assigned to application gateway
+ // See also: https://github.com/MicrosoftDocs/azure-docs/issues/34382
+ .withSoftDeleteEnabled()
+ .create();
+ return vault.secrets()
+ .define(secretName)
+ .withValue(secretValue)
+ .create();
+ }
+}
\ No newline at end of file
diff --git a/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManagePrivateDns.java b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManagePrivateDns.java
new file mode 100644
index 00000000000..3eb4d1a8606
--- /dev/null
+++ b/azure-samples/src/main/java/com/microsoft/azure/management/network/samples/ManagePrivateDns.java
@@ -0,0 +1,130 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.network.samples;
+
+import com.microsoft.azure.credentials.ApplicationTokenCredentials;
+import com.microsoft.azure.management.Azure;
+import com.microsoft.azure.management.network.Network;
+import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.privatednsManager;
+import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.RecordSetInner;
+import com.microsoft.azure.management.privatedns.v2018_09_01.ARecord;
+import com.microsoft.azure.management.privatedns.v2018_09_01.RecordType;
+import com.microsoft.azure.management.resources.fluentcore.arm.Region;
+import com.microsoft.azure.management.resources.fluentcore.utils.SdkContext;
+import com.microsoft.azure.SubResource;
+import com.microsoft.rest.LogLevel;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Azure Network sample for managing private DNS -
+ * - Create a private DNS zone
+ * - Update a virtual network.
+ * */
+
+public final class ManagePrivateDns {
+ /**
+ * Main function which runs the actual sample.
+ * @param azure instance of the azure client
+ * @param prDnsManager instance of PrivateDns client
+ * @return true if sample runs successfully
+ */
+ public static boolean runSample(Azure azure, privatednsManager prDnsManager) {
+ final Region region = Region.US_EAST;
+ final String rgName = SdkContext.randomResourceName("rg", 24);
+ final String nwName = SdkContext.randomResourceName("nw", 24);
+ final String regionDNS = "global"; // location always 'global' for privateDNS
+ final String privateDNSName = "private.contoso.com"; // private DNS name
+
+ try {
+ Network network = azure.networks().define(nwName)
+ .withRegion(Region.US_EAST)
+ .withNewResourceGroup(rgName)
+ .withAddressSpace("10.0.0.0/27")
+ .withSubnet("subnet1", "10.0.0.0/27")
+ .create();
+ //
+ // Private DNS hybrid sample
+ //
+ prDnsManager.privateZones().define(privateDNSName)
+ .withRegion(regionDNS)
+ .withExistingResourceGroup(rgName)
+ .withIfMatch(null)
+ .withIfNoneMatch(null)
+ .create();
+ prDnsManager.virtualNetworkLinks().define("linkToVnet")
+ .withExistingPrivateDnsZone(rgName, privateDNSName)
+ .withIfMatch(null)
+ .withIfNoneMatch(null)
+ .withLocation(regionDNS)
+ .withRegistrationEnabled(true)
+ .withVirtualNetwork(new SubResource().withId(network.id()))
+ .create();
+ RecordSetInner recordSetInner = new RecordSetInner();
+ ARecord arecord = new ARecord();
+ arecord.withIpv4Address("10.0.0.10"); // IP Address for record
+ List list = new ArrayList();
+ list.add(arecord);
+ recordSetInner.withARecords(list);
+ recordSetInner.withTtl(1L);
+ String alias = "db"; //alias for IP
+ prDnsManager.recordSets().inner().createOrUpdate(
+ rgName,
+ privateDNSName,
+ RecordType.A,
+ alias,
+ recordSetInner);
+ return true;
+ } catch (Exception e) {
+ System.err.println(e.getMessage());
+ e.printStackTrace();
+ } finally {
+ try {
+ System.out.println("Deleting Resource Group: " + rgName);
+ azure.resourceGroups().beginDeleteByName(rgName);
+ } catch (NullPointerException npe) {
+ System.out.println("Did not create any resources in Azure. No clean up is necessary");
+ } catch (Exception g) {
+ g.printStackTrace();
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Main entry point.
+ * @param args the parameters
+ */
+ public static void main(String[] args) {
+ try {
+ //=============================================================
+ // Authenticate
+
+ final File credFile = new File(System.getenv("AZURE_AUTH_LOCATION"));
+ final ApplicationTokenCredentials cred = ApplicationTokenCredentials.fromFile(credFile);
+ //
+ Azure azure = Azure.configure()
+ .withLogLevel(LogLevel.BODY)
+ .authenticate(credFile)
+ .withDefaultSubscription();
+ privatednsManager prDnsManager = privatednsManager.authenticate(cred, cred.defaultSubscriptionId());
+ // Print selected subscription
+ //
+ System.out.println("Selected subscription: " + azure.subscriptionId());
+ //
+ runSample(azure, prDnsManager);
+ } catch (Exception e) {
+ System.out.println(e.getMessage());
+ e.printStackTrace();
+ }
+ }
+
+ private ManagePrivateDns() {
+ }
+}
diff --git a/azure-samples/src/test/java/com/microsoft/azure/management/samples/PrivateDnsSampleTests.java b/azure-samples/src/test/java/com/microsoft/azure/management/samples/PrivateDnsSampleTests.java
new file mode 100644
index 00000000000..d2900dd0296
--- /dev/null
+++ b/azure-samples/src/test/java/com/microsoft/azure/management/samples/PrivateDnsSampleTests.java
@@ -0,0 +1,22 @@
+/**
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for
+ * license information.
+ */
+
+package com.microsoft.azure.management.samples;
+
+import com.microsoft.azure.management.network.samples.ManagePrivateDns;
+import com.microsoft.azure.management.privatedns.v2018_09_01.implementation.privatednsManager;
+import org.junit.Assert;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class PrivateDnsSampleTests extends SamplesTestBase {
+ @Test
+ @Ignore
+ public void testManagePrivateDns() {
+ privatednsManager prDnsManager = privatednsManager.authenticate(restClient, azure.subscriptionId());
+ Assert.assertTrue(ManagePrivateDns.runSample(azure, prDnsManager));
+ }
+}
diff --git a/azure-samples/src/test/java/com/microsoft/azure/management/samples/SamplesTestBase.java b/azure-samples/src/test/java/com/microsoft/azure/management/samples/SamplesTestBase.java
index b3e6713d805..e7f4f4ae3a9 100644
--- a/azure-samples/src/test/java/com/microsoft/azure/management/samples/SamplesTestBase.java
+++ b/azure-samples/src/test/java/com/microsoft/azure/management/samples/SamplesTestBase.java
@@ -12,6 +12,7 @@
public class SamplesTestBase extends TestBase {
protected Azure azure;
+ protected RestClient restClient;
public SamplesTestBase() {
super(RunCondition.BOTH);
@@ -23,7 +24,8 @@ public SamplesTestBase(RunCondition runCondition) {
@Override
protected void initializeClients(RestClient restClient, String defaultSubscription, String domain) {
- azure = Azure
+ this.restClient = restClient;
+ this.azure = Azure
.authenticate(restClient, domain, defaultSubscription).withSubscription(defaultSubscription);
}