Giter Site home page Giter Site logo

Comments (5)

hovsepm avatar hovsepm commented on August 17, 2024

@pppchris could you provide the REST communication (e.g. Fiddler trace log)? That API version should be still available.

from azure-libraries-for-net.

hovsepm avatar hovsepm commented on August 17, 2024

From @pppchris on June 8, 2017 2:27

Sure, no worries.

Have tried different settings with the network interface (such as create a new one) but that throws a similar error but pointing to a different API version.

{
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_DS2"
    },
    "storageProfile": {
      "imageReference": {
        "id": "**image id**"
      },
      "osDisk": {
        "caching": "ReadWrite",
        "createOption": "fromImage",
        "managedDisk": {
          "storageAccountType": "Standard_LRS"
        }
      }
    },
    "osProfile": {
      "computerName": "**compname**",
      "adminUsername": "**admin user**",
      "adminPassword": "**admin pass**",
      "windowsConfiguration": {
        "provisionVMAgent": true,
        "enableAutomaticUpdates": true
      }
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "properties": {
            "primary": true
          },
          "id": "**network interface**"
        }
      ]
    }
  },
  "location": "eastus2",
  "tags": {
    "yey": "yey"
  }
}

from azure-libraries-for-net.

hovsepm avatar hovsepm commented on August 17, 2024

From @anuchandy on June 8, 2017 18:3

@pppchris

It will be great if you can share the code fragment and full fiddler trace as @hovsepm mentioned.

Mean time we would like to share some details about "Custom image", since it can be created in various ways.

You have mentioned that you are trying to create virtual machine from "Custom Image". There are mainly 3 ways to create "custom image".

  1. Custom image from native VHD
  2. Custom image by capturing a virtual machine
  3. Custom image from managed disks.

These 3 cases are covered in this UT. UT also shows how to create virtual machine from custom image.

The above listed ways of creating custom image feature is released along with managed disk. This is the new/recommended way of creating custom image.

There is older way of creating "custom image" (aka stored image) which is done by capturing a virtual machine based on un-managed disk. you can see the sample here. Looks like this sample covers your scenario though it shows how to use StoredLinuxImage instead of StoredWindowsImage.

from azure-libraries-for-net.

hovsepm avatar hovsepm commented on August 17, 2024

From @pppchris on June 9, 2017 1:2

Hey @hovsepm @anuchandy
What's the best way to dump the full trace so I can remove sensitive information? The JSON trace above was the trace request going off upon the create request.

I am using "Custom image by capturing a virtual machine". I used the JSON above in a Deployment Template it worked out any issues as well.

Code:

           var NetworkInterface = Azure.Repo.NetworkInterfaces.GetById(interface);
           var baseVM = Azure.Repo.VirtualMachines.Define(name)
                .WithRegion(Region.USEast2)
                .WithExistingResourceGroup(resourcegroup)
                .WithExistingPrimaryNetworkInterface(NetworkInterface)
                .WithWindowsCustomImage(imageuri)
                .WithAdminUsername(username)
                .WithAdminPassword(password)
                .WithSize(VirtualMachineSizeTypes.StandardDS2)
                .WithTag("yey", "yey")
                .Create();

from azure-libraries-for-net.

yaohaizh avatar yaohaizh commented on August 17, 2024

The compute API version has been updated.

from azure-libraries-for-net.

Related Issues (20)

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.