Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions azure/src/test/java/com/microsoft/azure/AzureTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
import com.microsoft.azure.management.compute.Publisher;
import com.microsoft.azure.management.compute.Sku;
import com.microsoft.azure.management.compute.VirtualMachineImage;
import com.microsoft.azure.management.resources.Deployment;
import com.microsoft.azure.management.resources.GenericResource;
import com.microsoft.azure.management.resources.Subscriptions;
import com.microsoft.azure.management.resources.fluentcore.arm.Region;
import com.microsoft.azure.management.resources.implementation.api.DeploymentMode;
import com.microsoft.azure.management.storage.StorageAccount;
import com.microsoft.azure.management.storage.implementation.api.SkuName;
import com.microsoft.rest.credentials.ServiceClientCredentials;
Expand Down Expand Up @@ -70,6 +72,30 @@ public void setup() throws Exception {
}
}

/**
* Tests ARM template deployments
* @throws IOException
* @throws CloudException
*/
@Test public void testDeployments() throws Exception {
String testId = String.valueOf(System.currentTimeMillis());
List<Deployment> deployments = azure.deployments().list();
System.out.println("Deployments: " + deployments.size());
Deployment deployment = azure.deployments()
.define("depl" + testId)
.withNewGroup("rg" + testId, Region.US_WEST)
.withTemplateLink(
"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vnet-two-subnets/azuredeploy.json",
"1.0.0.0")
.withParametersLink(
"https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/101-vnet-two-subnets/azuredeploy.parameters.json",
"1.0.0.0")
.withMode(DeploymentMode.COMPLETE)
.create();
System.out.println("Create deployment: " + deployment.correlationId());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you mean "CreateD deployment: " ?

}


/**
* Tests basic generic resources retrieval
* @throws Exception
Expand Down