使用Azure Resource Manger API创建Azure VM

时间:2016-03-30 12:33:48

标签: rest azure azure-virtual-machine azure-resource-manager arm-template

我正在使用以下azure rest api在Azure资源管理器模式下创建虚拟机

  

PUT   https://management.azure.com/subscriptions/ {订阅-ID} / resourceGroups / {资源组名} {/providers/Microsoft.Compute/virtualMachines/ VM-name}的验证= {真|假}&安培; API版本= {API -version}

虚拟机被创建并且它仍处于创建状态,因为我可以看到azure的状态或新门户 我能够将RDP引入机器。 但登录后失败了。

可能是什么原因? 我错过了什么?

注意:我正在使用图片创建虚拟机。 请求Json:

{
  "properties": {
    "hardwareProfile": {
      "vmSize": "Standard_A0"
    },
    "storageProfile": {

      "osDisk": {
            "osType": "Windows",
            "name": "goldentemplate-osDisk",
            "createOption": "FromImage",
            "image": {
              "uri": "https://storagename.blob.core.windows.net/system/Microsoft.Compute/Images/mytemplates/goldentemplate-osDisk.vhd"
            },
            "vhd": {
              "uri": "https://storagename.blob.core.windows.net/vmcontainersagar/sagargoden.vhd"
            },
            "caching": "None"
          }
    ,


      "dataDisks": []
    },
    "osProfile": {
      "computerName": "sagarHostVM",
      "adminUsername": "itadmin",
      "adminPassword": "Micr0s0ft12!@"
    },
    "networkProfile": {
      "networkInterfaces": [
        {
          "properties": {},
          "id": "/subscriptions/subscritpionid/resourceGroups/harigroup/providers/Microsoft.Network/networkInterfaces/sagarhostnic"
        }
      ]
    }
  },
  "name": "sagarHostVM",
  "type": "Microsoft.Compute/virtualMachines",
  "location": "WestUs",
  "tags": {}
}

0 个答案:

没有答案