Giter Club home page Giter Club logo

packer-azure-templates's Introduction

platforms author
linux
brentmcconnell

Packer scripts for building images in Azure

Running these Packer Samples

To run this sample:

Ensure you have an active Azure subscription and that the az CLI has been installed and authenticated.

To run the scripts as is you will also need a Resource Group named Images where the custom images will be placed.

NOTE: These scripts require environment variables to execute properly. The following are required:

- AZURE_CLIENTID
- AZURE_SECRET
- AZURE_SUBSCRIPTIONID
- AZURE_TENANTID
- AZURE_CLOUD
- AZURE_LOCATION

If you are running Azure Commerical use: export AZURE_CLOUD=Public

If you are in Azure Government: export AZURE_CLOUD=USGovernment

To get the locations you can use execute: az account list-locations

Helper Script

For those of us too lazy to actually set these variables manually there is a helper script in the scripts directory of this repo. This script requires 'jq' and 'zsh'. Using this script you can create an Azure authentication file and use it to set the variables above. It will determine the current Cloud you are logged into with az and also default to a specific region.

To create an Azure Auth file: az ad sp create-for-rbac --sdk-auth > my.azureauth

Once this file is created you can set these variables using the script: source ./az-set-azure-environment ./my.azureauth

Make sure you use source to execute the script. This will ensure the environment variables are maintained in your current shell.

Once the environment is setup correctly you can run the packer scripts normally: packer build ubuntu.json

More information

http://azure.com/

If you don't have a Microsoft Azure subscription you can get a FREE trial account here


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

packer-azure-templates's People

Contributors

emcconne avatar brentmcconnell avatar

Watchers

James Cloos avatar  avatar

Forkers

usri

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.