Code Monkey home page Code Monkey logo

azuretestdrive's Introduction

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

azuretestdrive's People

Contributors

bigbrd avatar divacc avatar microsoft-github-policy-service[bot] avatar serpop avatar shefymk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azuretestdrive's Issues

Is this repo uptodate?

I am working on building an ARM file for a project we are working on (test drive purposes),

I came across this repo to test my template.json, i tried the below command:

node test-drive.js validate ./samples/winvm/template.json

and i got the below error

throw new Error(No metadata nor default value found, parameter name: ${parameterName}"`);
^

Error: No metadata nor default value found, parameter name: vmName"
at createParameter (/home/sisadmin/sis/arm/AzureTestDrive/lib/template-svc.js:41:19)
at /home/sisadmin/sis/arm/AzureTestDrive/lib/template-svc.js:16:9
at /home/sisadmin/sis/arm/AzureTestDrive/node_modules/lodash/lodash.js:4967:15
at baseForOwn (/home/sisadmin/sis/arm/AzureTestDrive/node_modules/lodash/lodash.js:3032:24)
at /home/sisadmin/sis/arm/AzureTestDrive/node_modules/lodash/lodash.js:4936:18
at Function.forEach (/home/sisadmin/sis/arm/AzureTestDrive/node_modules/lodash/lodash.js:9410:14)
at Object.createParameters (/home/sisadmin/sis/arm/AzureTestDrive/lib/template-svc.js:15:7)
at validateTemplate (/home/sisadmin/sis/arm/AzureTestDrive/test-drive.js:95:34)
at Object. (/home/sisadmin/sis/arm/AzureTestDrive/test-drive.js:21:5)
`

Taking this more, this seems on purpose in the testing code, its either to add a default value to our parameters or a type in the metadata section.

I would add a type but the ones in the list doesn't seems to fit my params.

Any idea how to test my arm file for test drive?

Support use of AppSource (AzureTestDrive) without AAD Admin Consent

I would like to use AppSource (AzureTestDrive) framework without requiring my potential customers to go through AAD Admin Consent.

For example, a potential customer is authenticated with Acme AAD. My SaaS app is registered in AAD as a multi-tenant web application. I would like my potential customers to be able to provision a trial within my app without needing to be admin members of their Acme AAD. Also as my SaaS application does not require Admin permissions currently, in case the Acme AAD Admin disabled the ability for regular users to consent to applications what will happen?

If my app is already provisioned within Azure as a cluster, can I securely call a provisioning endpoint (Swagger API) in my SaaS application without requiring Logic Apps? My SaaS API already encapsulates all the provisioning/de-provisioning logic.

Do you support AAD v2 Endpoints?

Thx

TypeError: SubscriptionClient is not a constructor

When start a new test drive deployment session, the test drive script throws an error when trying to sign in with the service principal credential.

The same issue is reproducible in different machines with the same configuration.
Node.js version: 8.3.0

See the screenshot attached.
azuretestdrivestartsessionerror

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.