Last active
December 14, 2017 16:19
-
-
Save gregohardy/258df002e82ee76c8161e588baba4d72 to your computer and use it in GitHub Desktop.
All the API calls for an Azure ARM VM.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create Resource Group | |
HTTPS request | |
put subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName} | |
{ | |
"resourceGroupName": "ccgh792", | |
"subscriptionId": "c82736ee-c108-452b-8178-f548c95d18fe" | |
} | |
Body: | |
{ | |
"location": "westus" | |
} | |
HTTPS request | |
put subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName} | |
{ | |
"resourceGroupName": "ccgh792", | |
"accountName": "ccgh792stacc", | |
"subscriptionId": "c82736ee-c108-452b-8178-f548c95d18fe" | |
} | |
Body: | |
{ | |
"sku": { | |
"name": "Premium_LRS" | |
}, | |
"kind": "Storage", | |
"location": "westus", | |
"properties": { | |
"encryption": { | |
"services": { | |
"blob": { | |
"enabled": false | |
} | |
}, | |
"keySource": "Microsoft.Storage" | |
}, | |
"supportsHttpsTrafficOnly": false | |
} | |
} | |
Creating a virtual network for the VM | |
HTTPS request | |
put subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName} | |
{ | |
"resourceGroupName": "ccgh792", | |
"virtualNetworkName": "ccgh792vnet", | |
"subscriptionId": "c82736ee-c108-452b-8178-f548c95d18fe" | |
} | |
Body: | |
{ | |
"location": "westus", | |
"properties": { | |
"addressSpace": { | |
"addressPrefixes": [ | |
"10.0.0.0/16" | |
] | |
}, | |
"dhcpOptions": { | |
"dnsServers": [ | |
"8.8.8.8" | |
] | |
}, | |
"subnets": [ | |
{ | |
"properties": { | |
"addressPrefix": "10.0.0.0/24" | |
}, | |
"name": "ccgh792subnet" | |
} | |
] | |
} | |
} | |
Creating a public IP address for the VM | |
HTTPS request | |
put subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName} | |
{ | |
"resourceGroupName": "ccgh792", | |
"publicIpAddressName": "ccgh792pubip", | |
"subscriptionId": "c82736ee-c108-452b-8178-f548c95d18fe" | |
} | |
Body: | |
{ | |
"location": "westus", | |
"properties": { | |
"publicIPAllocationMethod": "Dynamic", | |
"dnsSettings": { | |
"domainNameLabel": "ccgh792domainlabel" | |
} | |
} | |
} | |
HTTPS request | |
put subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName} | |
{ | |
"resourceGroupName": "ccgh792", | |
"networkInterfaceName": "ccgh792nic", | |
"subscriptionId": "c82736ee-c108-452b-8178-f548c95d18fe" | |
} | |
Body: | |
{ | |
"location": "westus", | |
"properties": { | |
"ipConfigurations": [ | |
{ | |
"properties": { | |
"privateIPAllocationMethod": "Dynamic", | |
"subnet": { | |
"id": "/subscriptions/c82736ee-c108-452b-8178-f548c95d18fe/resourceGroups/ccgh792/providers/Microsoft.Network/virtualNetworks/ccgh792vnet/subnets/ccgh792subnet", | |
"properties": { | |
"addressPrefix": "10.0.0.0/24", | |
"provisioningState": "Succeeded" | |
}, | |
"name": "ccgh792subnet", | |
"etag": "W/\"23555825-9ef0-499e-8cfd-faf8dd6e5710\"" | |
}, | |
"publicIPAddress": { | |
"id": "/subscriptions/c82736ee-c108-452b-8178-f548c95d18fe/resourceGroups/ccgh792/providers/Microsoft.Network/publicIPAddresses/ccgh792pubip", | |
"location": "westus", | |
"sku": { | |
"name": "Basic" | |
}, | |
"properties": { | |
"publicIPAllocationMethod": "Dynamic", | |
"publicIPAddressVersion": "IPv4", | |
"dnsSettings": { | |
"domainNameLabel": "ccgh792domainlabel", | |
"fqdn": "ccgh792domainlabel.westus.cloudapp.azure.com" | |
}, | |
"idleTimeoutInMinutes": 4, | |
"resourceGuid": "4d2871f6-fada-420c-8e21-626247de95c6", | |
"provisioningState": "Succeeded" | |
}, | |
"etag": "W/\"46b291f3-50ab-4f5d-8f4e-2f2f49844e2e\"" | |
} | |
}, | |
"name": "sample-ruby-nic-ccgh792vm" | |
} | |
] | |
} | |
} | |
HTTPS request | |
put subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName} | |
{ | |
"resourceGroupName": "ccgh792", | |
"vmName": "ccgh792vm", | |
"subscriptionId": "c82736ee-c108-452b-8178-f548c95d18fe" | |
} | |
Body: | |
{ | |
"location": "westus", | |
"properties": { | |
"hardwareProfile": { | |
"vmSize": "Standard_DS2_v2" | |
}, | |
"storageProfile": { | |
"imageReference": { | |
"publisher": "canonical", | |
"offer": "UbuntuServer", | |
"sku": "16.04.0-LTS", | |
"version": "latest" | |
}, | |
"osDisk": { | |
"name": "ccgh792-os-disk", | |
"vhd": { | |
"uri": "https://ccgh792stacc.blob.core.windows.net/rubycontainer/ccgh792vm.vhd" | |
}, | |
"caching": "None", | |
"createOption": "FromImage" | |
} | |
}, | |
"osProfile": { | |
"computerName": "ccgh792vm", | |
"adminUsername": "notAdmin", | |
"adminPassword": "Pa$$w0rd92", | |
"linuxConfiguration": { | |
"disablePasswordAuthentication": true, | |
"ssh": { | |
"publicKeys": [ | |
{ | |
"path": "/home/notAdmin/.ssh/authorized_keys", | |
"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCuKyP9c4h3vujCk/b097W3R5PrrUr4/Up9QtWIn1hN3P3m59Cxa2Wmmre9fWVO2pCvfLMfy5kR+Jm8CLKCG/edGran32LAAKKA5AlZaJjA69S0YPLrMFN07myfGHy0yZj41sUZ95AS5xZRl21pQ77CULokNkXkZX+D0SeV5Y0Kth6oDQZrgfsLSLxwcEVW1MxvvaIb9cL3sRkJgw4w6+5m2zNg6saAFr1/YVu25G92dFxKaN/f3unGICSCxQgimSM+mKLjxlAW2xx1IotEULiHWR9zsTv/hthDldIvYRvj8ZRGreby7d1qWVjGSLZ1qE1Wct7yHVjmRHWtSqqPyflz [email protected]\n" | |
} | |
] | |
} | |
} | |
}, | |
"networkProfile": { | |
"networkInterfaces": [ | |
{ | |
"id": "/subscriptions/c82736ee-c108-452b-8178-f548c95d18fe/resourceGroups/ccgh792/providers/Microsoft.Network/networkInterfaces/ccgh792nic", | |
"properties": { | |
"primary": true | |
} | |
} | |
] | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment