Skip to content
Matthew Kelly edited this page Jul 30, 2017 · 4 revisions

Overview

For the Foggfile, please see: Foggfile

To use Fogg, you merely call the fogg command from a PowerShell command-line. Below is a basic example of calling Fogg:

fogg -SubscriptionName "Azure Subscription" -ResourceGroupName "basic-rg" -Location "westeurope" -VNetAddress "10.1.0.0/16" -SubnetAddresses @{"vm"="10.1.0.0/24"} -TemplatePath ".\fogg-template.json"

And the following is the fogg-template.json referenced:

{
    "template": [
        {
            "tag": "test",
            "type": "vm",
            "count": 1,
            "os": {
                "type": "Windows",
                "size": "Standard_DS1_v2",
                "publisher": "MicrosoftWindowsServer",
                "offer": "WindowsServer",
                "skus": "2016-Datacenter"
            },
            "usePublicIP": true
        }
    ]
}

Above we've assumed that you have an Azure Subscription called "Azure Subscription".

This doc is only for calling the fogg command, so if you wish for more information on the template please see the template docs.

Once called, Fogg we do the following with the above template and command arguments:

  • Validate the template file
  • Request for you Azure Subscription credentials
  • Request for administrator credentials to deploy the VMs
  • Create a Resource Group called basic-rg in Location westeurope
  • Create a Storage Account called basicstdsa (or basic-std-sa for Standard Storage)
  • Create a Virtual Network called basic-vnet for address 10.1.0.0/16
  • Create a Network Security Group (basic-vm1-nsg) and Subnet (basic-vm1-snet) for address 10.1.0.0/24
  • Create an Availability Set called basic-vm-as
  • A Virtual Machine called basic-vm1 will then be deployed under the basic-vm1-snet Subnet

As you can see, Fogg does quite a lot for you from a small template.

Argument Descriptions

In general, here are what the arguments on the command mean. This covers all the possible arguments, including ones not used above:

You can also run Get-Help fogg in a PowerShell window for more information as well

Argument Type Description
FoggfilePath String Path to a Foggfile, can be absolute or relative
IgnoreCores Switch Fogg will ensure your template don't exist the Azure core limit for your subscription. -IgnoreCores will run the check and report for you, but ignore the result
Location String The location of where the VMs, etc. will be deployed (ie, westeurope)
NoOutput Switch Tells Fogg not to return the resulant object containing information about what was just deployed
ResourceGroupName String The name of the Resource Group you wish to create or use in Azure
SubscriptionCredentials PSCredential This is your Azure Subscription credentials, to allow Fogg to create and deploy in Azure. These credentials will only work for Organisational/Work accounts - NOT Personal ones
SubnetAddresses Map This is a map of subnet addresses for VMs (ie, @{'web'='10.1.0.0/24'}). The key is the tag name of the VM, and there must be a subnet for each VM section in you template. You can pass more subnets than you have VMs (for linking/firewalling to existing ones), as these can be referenced in firewalls as "@{subnet
SubscriptionName String The name of the Subscription you are using in Azure
TemplatePath String Path to your Fogg template file, can be absolute or relative
Validate Switch Tells Fogg to only run validation over the Foggfile and template files
Version Switch Simply displays the current version of Fogg
VMCredentials PSCredential This is the administrator credentials that will be used to create each VM. They are the credentials that you would use to login to the admin account after a VM has been created (ie, to remote onto a VM)
VNetAddress String Used when creating a new Virtual Network, this is the address prefix (ie, 10.1.0.0/16)
VNetName String Paired with VNetResourceGroupName, if passed will use an existing Virtual Network in Azure
VNetResourceGroupName String Paired with VNetName, if passed will use an existing Virtual Network in Azure

If you do not supply a SubscriptionName, SubscriptionCredentials or VMCredentials then Fogg will request you to imput them before it can proceed

You can pass either a VNetAddress OR a VNetName + VNetResourceGroupName. You do not have to pass all 3 arguments

Clone this wiki locally