Experience: is what you get soon after you need it.

Experience: is what you get soon after you need it.



My Cloud Certifications:

GIAC Cloud Penetration Tester (GCPN)

GIAC Cloud Security Automation (GCSA)

GIAC Security Essentials (GSEC)

Certified Kubernetes Administrator (CKA)

Cloud Certified Security Professional (ISC2)

CyberSecurity Certified Professional (ISC2)

AWS Certified Solutions Architect Associate

Azure Certified Architect Expert

Azure Certified Architect

Azure Certified Administrator

Oracle Cloud Infrastructure 2018 Certified Architect Associate.

Oracle Cloud Infrastructure Classic 2018 Certified Architect Associate.

Oracle Database Cloud Administrator Certified Professional.

Oracle Database Cloud Service Operations Certified Associate.

Search This Blog

Wednesday, April 28, 2021

How to export VM Image in Azure



How to export VM Image in Azure



Create the snapshot using the below JSON template, if you already have a snapshot then you can skip this step.


{

  "id": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Resources/deployments/Snapshot.az-mydisk-os-post-upgrade-20210428111917",

  "name": "Snapshot.az-mydisk-os-post-upgrade-20210428111917",

  "type": "Microsoft.Resources/deployments",

  "tags": {

    "primaryResourceId": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Compute/snapshots/az-mydisk-os-post-upgrade",

    "marketplaceItemId": "Microsoft.Snapshot"

  },

  "properties": {

    "templateHash": "13238197693155926102",

    "parameters": {

      "apiVersion": {

        "type": "String",

        "value": "2020-09-30"

      },

      "name": {

        "type": "String",

        "value": "az-mydisk-os-post-upgrade"

      },

      "location": {

        "type": "String",

        "value": "eastus"

      },

      "accountType": {

        "type": "String",

        "value": "Standard_LRS"

      },

      "createOption": {

        "type": "String",

        "value": "Copy"

      },

      "sourceUri": {

        "type": "String",

        "value": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Compute/disks/mydisk_OsDisk_1_29a2c78fb9b8b27"

      },

      "incremental": {

        "type": "String",

        "value": "false"

      },

      "diskEncryptionSetType": {

        "type": "String",

        "value": "EncryptionAtRestWithPlatformKey"

      },

      "networkAccessPolicy": {

        "type": "String",

        "value": "DenyAll"

      }

    },

    "mode": "Incremental",

    "debugSetting": {

      "detailLevel": "None"

    },

    "provisioningState": "Succeeded",

    "timestamp": "2021-04-28T15:19:28.849237Z",

    "duration": "PT12.642492S",

    "correlationId": "2008b5e6-9306-4413-b595-0663861bd405",

    "providers": [

      {

        "namespace": "Microsoft.Compute",

        "resourceTypes": [

          {

            "resourceType": "snapshots",

            "locations": [

              "eastus"

            ]

          }

        ]

      }

    ],

    "dependencies": [],

    "outputResources": [

      {

        "id": "/subscriptions/subid/resourceGroups/MYAPP/providers/Microsoft.Compute/snapshots/az-mydisk-os-post-upgrade"

      }

    ],

    "validationLevel": "Template"

  }

}


Make sure that you have appropriate access level set while creating the snapshot. Only with public endpoint connectivity method you will be able to export the snapshot and share it outside of your VNET.













Then snapshot export:


















If you don't see the Generate URL option then change the networking settings to public for this snapshot.















Now click on Generate URL:




Now copy the url in a browser and download the entire image, you can also use wget via command line to download the image.







No comments: