Using Self-Test API to validate VM images for publishing in Azure Marketplace

  • Windows-only GUI certification tool that can be used to validate both Linux and Windows VM images
  • Self-Test REST API that can be invoked from either Linux or Windows without using the GUI tool

Video Walkthrough

Azure Active Directory Token

curl --location --request POST 'https://login.microsoftonline.com/{TENANT_ID}/oauth2/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id={CLIENT_ID} ' \
--data-urlencode 'client_secret={CLIENT_SECRET}' \
--data-urlencode 'resource=https://management.core.windows.net'
{
"token_type": "Bearer",
"expires_in": "86399",
"ext_expires_in": "86399",
"expires_on": "1599663998",
"not_before": "1599577298",
"resource": "https://management.core.windows.net",
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJS…"
}

Self-Test API

curl --location --request POST 'https://isvapp.azurewebsites.net/selftest-vm' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGci...' \
--data-raw '{
"DNSName": "your_running_vm_dns_or_ip_address",
"UserName": "YOUR_VM_USERNAME",
"Password": "SECURE_PASSWORD_FOR_THE_SSH_INTO_VM",
"OS": "Linux",
"PortNo": "22",
"CompanyName": "COMPANY_NAME",
"AppId": "CLIENT_ID_SAME_AS_USED_FOR_AAD_TOKEN ",
"TenantId": "TENANT_ID_SAME_AS_USED_FOR_AAD_TOKEN"
}'
{"TrackingId": "9bffc887-dd1d-40dd-a8a2-34cee4f4c4c3",
"Response": "{\"SchemaVersion\":1,\"AppCertificationCategory\":\"Microsoft Single VM Certification\",\"ProviderID\":\"050DE427-2A99-46D4-817C-5354D3BF2AE8\",\"OSName\":\"Ubuntu 18.04\",\"OSDistro\":\"Ubuntu 18.04.5 LTS\",\"KernelVersion\":\"5.4.0-1023-azure\",\"KernelFullVersion\":\"Linux version 5.4.0-1023-azure (buildd@lgw01-amd64-053) (gcc version 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04)) #23~18.04.1-Ubuntu SMP Thu Aug 20 14:46:48 UTC 2020\\n\",\"OSVersion\":\"18.04\",\"CreatedDate\":\"09/08/2020 01:13:47\",\"TestResult\":\"Pass\",\"APIVersion\":\"1.5\",\"Tests\":[{\"TestID\":\"48\",\"TestCaseName\":\"Bash History\",\"Description\":\"Bash history files should be cleared before creating the VM image.\",\"Result\":\"Passed\",\"ActualValue\":\"No file Exist\",\"RequiredValue\":\"1024\"},...removed for brevity...}]}"}

My other posts and videos about Azure VM offers

--

--

--

Principal Engineer / Architect, FastTrack for Azure at Microsoft

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

List Comprehensions

How to burn 6000 in Google Cloud

Android Image Capture, Save in Storage and Showing in Image View

Creating a successful and useable enterprise application

Automation Testing

Kubernetes w/ Let’s Encrypt & Cloud DNS

CS 371p Final Entry

Graph database design for our social travel App

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Arsen Vladimirskiy

Arsen Vladimirskiy

Principal Engineer / Architect, FastTrack for Azure at Microsoft

More from Medium

Deploy Web API to Azure API Management via Azure Devops CI/CD pipelines — Part 2

Azure Bicep: Deploy Morpheus Data Appliance on Ubuntu 20.04LTS

How to Create a Log Analytics Workspace in Azure Portal

How To Azure — Azure Cloud Shell-5