Skip to content

Build a Test Drive solution to allow customers to try before they buy your product. This repository contains a development helper tool to help build, test, and debug your test drive.

Notifications You must be signed in to change notification settings

Azure/AzureTestDrive

Repository files navigation

Azure Test Drive

Azure Test Drive enables customers the option to "try before you buy" products found on Azure Marketplace.

We have a full Wiki to walkthrough what a Test Drive is and how to build one!

Below is our ReadMe for a prototype tool to help to develop, test, and debug your own Azure Test Drive ARM template solution.

Azure Test Drive Dev Kit

Installation

This project uses Node.js and runs on Windows, Mac OS and Linux machines. Please follow the following steps to install the project:

  1. Make sure you have Node.js v6.9.1 or higher. Follow instructions on this page to install or update Node.js.

  2. Clone the repository (or download the latest version):

git clone https://github.com/Azure/AzureTestDrive.git
  1. Install all dependencies:
npm install

Now you can run Dev Kit tools using Node.js:

node test-drive.js [COMMAND] [PARAMETERS]

Quick Guide

Validate

The validate command performs the basic validation on your template, and displays the sample set of parameters which Azure Test Drive will use to instantiate a template.

node test-drive.js validate samples/contoso_simple_package/main-template.json

Output:

Template is valid
Parameters created
{
  "baseUri": {
    "value": "https://aztestdrive.blob.core.windows.net/your-deployment-package/"
  },
  "sessionId": {
    "value": "862b2264-fc3a-4ae1-a9e3-1e9cc2e2f95f"
  },
  "username": {
    "value": "admin41081"
  },
  "password": {
    "value": "UGo5igjz8j"
  }
}

Start Session

The start session command instantiates your template using the specified Azure subscription.

node test-drive.js start settings.json [<session-name>]

Where:

  • settings.json is a file containing information which is required to instantiate the template.
  • session-name is an optional session name. You can run multiple sessions in parallel by specifying different session names.

Output:

Session Details created
{
  "publisherId": ...
}
Downloading template: https://...
Template downloaded
Parameters created
{
  "baseUri": ...
}
Session Details saved
Signing in...
Signed in
Creating Resource Group: CloudTry_585f9917ac694989bede259efe941e49
Resource Group created
{
  "id": ...
}
Creating Deployment...
Deployment created
{
  "id": ...
}

Here is the sample settings.json (subscription id, tenant id, app id and app key parameters are not real):

{
  "$schema": "settings-schema.json",
  "publisherId": "contoso",
  "labId": "simple",
  "subscriptionInfo": {
    "subscriptionId": "12c51fe2-f7ee-46c6-8fc4-cc45069e8b97",
    "tenantId": "243d82c9-14d1-439a-91f8-546ec8708148",
    "appId": "313c023c-98bb-4492-ad10-49db39af81e1",
    "appKey": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="
  },
  "location": "westus",
  "deploymentTemplateUri": "https://aztestdrive.blob.core.windows.net/artifacts/contoso/simple/main-template.json",
  "baseUri": "https://aztestdrive.blob.core.windows.net/artifacts/contoso/simple/"
}
Name Data Type Comments
publisherId String Publisher identifier (lower-case letters, digits and dash character only).
labId String Lab identifier (lower-case letters, digits and dash character only).
subscriptionInfo Object Target subscription details.
subscriptionId GUID Subscription Id.
tenantId GUID Tenant Id.
appId GUID AD Application Id (see details below).
appKey String AD Application password (see details below).
location String Target deployment location.
deploymentTemplateUri Uri Uri of your deployment template somewhere on the PUBLIC blob storage
baseUri Uri Base Uri of your deployment template

Please note, this project, as well as Azure Test Drive, use service principal to access your subscription.

Get Deployment Status

Template deployment is a long-running operation. The get deployment status command displays the status of your deployment.

node test-drive.js status [<session-name>]

Output:

Session Details loaded
{
  "publisherId": ...
}
Signing in...
Signed in
Retrieving Deployment...
Deployment retrieved
{
  "id": ...
}
Deployment Status: Success

Get Deployment Operations

The get deployment operations command displays information about every deployment operation from your template:

node test-drive.js operations [<session-name>]

Output:

Session Details loaded
{
  "publisherId": ...
}
Signing in...
Signed in
Retrieving Deployment Operations...
Deployment Operations retrieved
[
  {
    "id": ...
  },
  ...
]

This information is also available through the Azure Portal.

Stop Session

The stop session command performs a cleanup. Basically, it just deletes the resource group which was used for deployment:

node test-drive.js stop [<session-name>]

Output:

Session Details loaded
{
  "publisherId": ...
}
Signing in...
Signed in
Deleting Resource Group: CloudTry_585f9917ac694989bede259efe941e49
Resource Group scheduled for deletion

Documentation

About

Build a Test Drive solution to allow customers to try before they buy your product. This repository contains a development helper tool to help build, test, and debug your test drive.

Resources

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published