From 7b9fa48a1bc4802ce84cbe4d7b77bf6a7ea38915 Mon Sep 17 00:00:00 2001 From: Chris Bednarski Date: Mon, 14 Mar 2016 17:21:21 -0700 Subject: [PATCH] Added initial azure documentation --- website/source/docs/builders/azure.html.md | 93 ++++++++++++++++++++++ website/source/layouts/docs.erb | 1 + 2 files changed, 94 insertions(+) create mode 100644 website/source/docs/builders/azure.html.md diff --git a/website/source/docs/builders/azure.html.md b/website/source/docs/builders/azure.html.md new file mode 100644 index 000000000..383049f44 --- /dev/null +++ b/website/source/docs/builders/azure.html.md @@ -0,0 +1,93 @@ +--- +description: | + +layout: docs +page_title: Azure Resource Manager +... + +# Azure Resource Manager Builder + +Type: `azure-arm` + +Packer supports building VHDs in [Azure Resource Manager](https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/). Azure provides new users a [$200 credit for the first 30 days](https://azure.microsoft.com/en-us/free/); after which you will incur costs for VMs built and stored using Packer. + +Unlike most Packer builders, the artifact produced by the ARM builder is a VHD (virtual hard disk), not a full virtual machine image. This means you will need to [perform some additional steps](https://github.com/Azure/packer-azure/issues/201) in order to launch a VM from your build artifact. + +Azure uses a combination of OAuth and Active Directory to authorize requests to the ARM API. Learn how to [authorize access to ARM](/docs/builders/azure-setup.html). + +The documentation below references command output from the [Azure CLI](https://azure.microsoft.com/en-us/documentation/articles/xplat-cli-install/). + +-> At this time packer supports building Linux virtual machines in Azure. Support for building Windows VMs is in progress and will be added in an upcoming release. + +## Configuration Reference + +The following configuration options are available for building Azure images. In addition to the options listed here, a +[communicator](/docs/templates/communicator.html) can be configured for this +builder. + +### Required: + +- `client_id` (string) The Active Directory service principal associated with your builder. + +- `client_secret` (string) The password or secret for your service principal. + +- `resource_group_name` (string) Resource group under which the final artifact will be stored. + +- `storage_account` (string) Storage account under which the final artifact will be stored. + +- `subscription_id` (string) Subscription under which the build will be performed. **The service principal specified in `client_id` must have full access to this subscription.** + +- `tenant_id` (string) The account identifier with which your `client_id` and `subscription_id` are associated. + +- `capture_container_name` (string) Destination container name. Essentially the "folder" where your VHD will be organized in Azure. + +- `capture_name_prefix` (string) VHD prefix. The final artifacts will be named `PREFIX-osDisk.UUID` and `PREFIX-vmTemplate.UUID`. + +- `image_publisher` (string) PublisherName for your base image. See [documentation](https://azure.microsoft.com/en-us/documentation/articles/resource-groups-vm-searching/) for details. + + CLI example `azure vm image list-publishers -l westus` + +- `image_offer` (string) Offer for your base image. See [documentation](https://azure.microsoft.com/en-us/documentation/articles/resource-groups-vm-searching/) for details. + + CLI example `azure vm image list-offers -l westus -p Canonical` + +- `image_sku` (string) SKU for your base image. See [documentation](https://azure.microsoft.com/en-us/documentation/articles/resource-groups-vm-searching/) for details. + + CLI example `azure vm image list-skus -l westus -p Canonical -o UbuntuServer` + +- `location` (string) Azure datacenter in which your VM will build. + + CLI example `azure location list` + +- `vm_size` (string) Size of the VM used for building. This can be changed when you deploy a VM from your VHD. See [pricing](https://azure.microsoft.com/en-us/pricing/details/virtual-machines/) information. + + CLI example `azure vm sizes -l westus` + +## Basic Example + +Here is a basic example for Azure. + +``` {.javascript} +{ + "type": "azure-arm", + + "client_id": "{{user `client_id`}}", + "client_secret": "{{user `client_secret`}}", + "resource_group_name": "{{user `resource_group`}}", + "storage_account": "{{user `storage_account`}}", + "subscription_id": "{{user `subscription_id`}}", + "tenant_id": "{{user `tenant_id`}}", + + "capture_container_name": "images", + "capture_name_prefix": "packer", + + "image_publisher": "Canonical", + "image_offer": "UbuntuServer", + "image_sku": "14.04.3-LTS", + + "location": "West US", + "vm_size": "Standard_A2" +} +``` + +See the [examples/azure](https://github.com/mitchellh/packer/tree/master/examples/azure) folder in the packer project for more examples. diff --git a/website/source/layouts/docs.erb b/website/source/layouts/docs.erb index 68806bab5..961a7c22a 100644 --- a/website/source/layouts/docs.erb +++ b/website/source/layouts/docs.erb @@ -36,6 +36,7 @@

Builders

  • Amazon EC2 (AMI)
  • +
  • Azure Resource Manager
  • DigitalOcean
  • Docker
  • Google Compute Engine