# 4.1.1 - Azure Image

This will walk you through the process to retrieve the details for a specific image from the Azure marketplace, Azure Cloud Shell and Azure CLI

A Tuono Blueprint allows you to specify multiple [images](https://docs.tuono.com/userguide/reference/schema/compute/image) to deploy into your cloud providers. To specify an image from the Azure marketplace we need the **Publisher, Product** and **SKU** of the image. This snippet shows how an image is defined under compute.vm.image schema.

```
compute:
  image:
    windows:
      publisher: cognosys
      product: hardened-iis-on-windows-datacenter-2019 
      sku: hardened-iis-on-windows-datacenter-2019
```

## Azure Marketplace

1. From the [Azure marketplace](https://azuremarketplace.microsoft.com/en-us) navigate to the desired VM that you would like to create, click ***GET IT NOW*** and ***Continue,*** granting Microsoft permissions and agreeing to the pricing - where required.&#x20;

In our example we will use the VM [Hardened IIS On Windows Datacenter 2019](https://azuremarketplace.microsoft.com/en-us/marketplace/apps/cognosys.hardened-iis-on-windows-datacenter-2019?tab=Overview)*.* This image has an associated cost, so permissions must be granted to use it in your Blueprints.

![](https://4172935707-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAzdR4AyersVibQD8Ei%2Fsync%2F29936b5afe5499eb5cb931f0a3882fde7b622171.png?generation=1611242583876394\&alt=media)

1. On the VM page select the ***Usage Information + Support*** tab.

Copy the following information:

* Publisher ID: ***cognosys***
* Offer ID: *hardened-iis-on-windows-datacenter-2019*
* Plan ID: *hardened-iis-on-windows-datacenter-2019*&#x20;

![](https://4172935707-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MAzdR4AyersVibQD8Ei%2Fsync%2Ffebc970c24503c47080ddcb06516fa12f8fb8c23.png?generation=1611242583629282\&alt=media)

1. Create an [image](https://docs.tuono.com/userguide/reference/schema/compute/image#required-properties) in your Blueprint and add the required:
2. ***publisher*** = Publisher ID
3. ***product*** = Offer ID
4. ***sku*** = Plan ID

```
compute:
  image:
    windows:
      publisher: cognosys
      product: hardened-iis-on-windows-datacenter-2019 
      sku: hardened-iis-on-windows-datacenter-2019
```

## Azure Powershell

1. Open the [Azure Cloud Shell.](https://shell.azure.com/)
2. Select a subscription and create a storage account by clicking ***Create storage***
3. Change the environment type to ***Powershell*** in the top left

![](https://firebasestorage.googleapis.com/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MAzdR4AyersVibQD8Ei%2Fuploads%2FXGWdHiwRU1coOjNJjUje%2Ffile.png?alt=media)

1. [Find an image](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/cli-ps-findimage) from a specific region, using Powershell within the Cloud Shell

```
Get-AzVMImageOffer -Location "east us" -PublisherName "cognosys"
```

* Search the table to find your specific ***Offer*** and ***PublisherName*** details.

```
Offer                                    PublisherName  Location   Id
-----                                    -------------  --------   --
hardened-iis-on-windows-datacenter-2019  cognosys       eastus     /Subscriptions/33de00cd-d545-47cb-8939-193f9b5fafa4/Providers/Microsoft.Compute/Locations/eastus/Publishers/cognosys/ArtifactTypes/VMImage/Offers/hardened-iis-on…
```

1. Get the ***Skus*** of the specific image, using the ***Offer*** and ***PublisherName*** from the previous step

```
Get-AzVMImageSku -Location "east us" -PublisherName "cognosys" -Offer "hardened-iis-on-windows-datacenter-2019"
```

* This will return:

```
Skus                                    Offer                                   PublisherName  Location   Id
----                                    -----                                   -------------  --------   --
hardened-iis-on-windows-datacenter-2019 hardened-iis-on-windows-datacenter-2019 cognosys       eastus     /Subscriptions/33de00cd-d545-47cb-8939-193f9b5fafa4/Providers/Microsoft.Compute/Locations/eastus/Publishers/cognosys/ArtifactTypes/V…
```

1. Create an [image](https://docs.tuono.com/userguide/reference/schema/compute/image#required-properties) in your Blueprint using the obtained information.

```
compute:
  image:
    windows:
      publisher: cognosys
      product: hardened-iis-on-windows-datacenter-2019 
      sku: hardened-iis-on-windows-datacenter-2019
```

## Azure CLI

1. [Install the Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest) or use [Azure Cloud Shell](https://shell.azure.com/) to use the Azure CLI

{% hint style="info" %}
For local installation, you'll need to log in and follow the prompts:

```
az login
```

{% endhint %}

* For Cloud Shell, change the environment type to ***Bash*** in the top left
* Use the [*az vm image list*](https://docs.microsoft.com/en-us/cli/azure/vm/image?view=azure-cli-latest#az_vm_image_list) command to search for specific images:

```
az vm image list --all --offer "IIS" --publisher "cognosys" --output table
```

* Search the table to find your specific image details.

```
Offer                                             Publisher   Sku                                               Urn                                                                                                                Version
------------------------------------------------- ----------- ------------------------------------------------- ------------------------------------------------------------------------------------------------------------------ -----------
hardened-iis-on-windows-datacenter-2019           cognosys    hardened-iis-on-windows-datacenter-2019           cognosys:hardened-iis-on-windows-datacenter-2019:hardened-iis-on-windows-datacenter-2019:1.0.1                      1.0.1
```

1. Create an [image](https://docs.tuono.com/userguide/reference/schema/compute/image#required-properties) in your Blueprint using the obtained information.

```
compute:
  image:
    windows:
      publisher: cognosys
      product: hardened-iis-on-windows-datacenter-2019 
      sku: hardened-iis-on-windows-datacenter-2019
```
