regex - Why does New-AzureRmVM give entity name error? -


when run code powershell ise

new-azurermvm -resourcegroupname $resourcegroupname -location $location -vm $vm 

i error

new-azurermvm : entity name invalid according validation rule: ^[^_\w][\w-._]{0,79}(?<![-.])$. statuscode: 400 reasonphrase: bad request operationid : 'my-operation-id' @ line:1 char:1 + new-azurermvm -resourcegroupname $resourcegroupname -location $location -vm $vm + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     + categoryinfo          : closeerror: (:) [new-azurermvm], computecloudexception     + fullyqualifiederrorid : microsoft.azure.commands.compute.newazurevmcommand 

$resourcegroupname contains resource group name, "foobar.com" in example.

$location contains "east 2".

$vm contains vm config below

resourcegroupname        :  id                       :  name                     : foobar type                     :  location                 :  tags                     : null availabilitysetreference : null diagnosticsprofile       : {                              "bootdiagnostics": {                                "enabled": true,                                "storageuri": "https://foobar.blob.core.windows.net/"                              }                            } extensions               : null hardwareprofile          : {                              "vmsize": "basic_a0"                            } instanceview             : null networkprofile           : {                              "networkinterfaces": [                                {                                  "properties.primary": null,                                  "id": "/subscriptions/my-sub-id/resourcegroups/foobar.com/providers/microsoft.network/n                            etworkinterfaces/foobar"                                }                              ]                            } osprofile                : {                              "computername": "foobar",                              "adminusername": "admin",                              "adminpassword": "password",                              "customdata": null,                              "windowsconfiguration": {                                "provisionvmagent": true,                                "enableautomaticupdates": true,                                "timezone": "utc-05:00",                                "additionalunattendcontent": null,                                "winrm": null                              },                              "linuxconfiguration": null,                              "secrets": null                            } plan                     : null provisioningstate        :  storageprofile           : {                              "imagereference": {                                "publisher": "microsoftwindowsserver",                                "offer": "windowsserver",                                "sku": "windows-server-technical-preview",                                "version": "latest"                              },                              "osdisk": {                                "ostype": null,                                "encryptionsettings": null,                                "name": "os disk",                                "vhd": {                                  "uri": "https://foobar.blob.core.windows.net/vhds/foobar-os.vhd"                                },                                "image": null,                                "caching": null,                                "createoption": "fromimage",                                "disksizegb": null                              },                              "datadisks": [                                {                                  "lun": 0,                                  "name": "data disk",                                  "vhd": {                                    "uri": "https://foobar.blob.core.windows.net/vhds/foobar-data.vhd"                                  },                                  "image": null,                                  "caching": null,                                  "createoption": "empty",                                  "disksizegb": 20                                }                              ]                            } datadisknames            : {data disk} networkinterfaceids      : {/subscriptions/my-sub-id/resourcegroups/foobar.com/providers/microsoft.network/networkinterf                            aces/foobar} 

can please tell me entity name referring is? name of vm, name of 1 of storage locations, etc? far can tell, matches regex don't understand why i'm getting error. googling command name brings few hits, , none mention entity names @ all.

never mind, figured out through trial , error. data , os disks apparently can't have spaces in name. would've helped if azure ps module better documented.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -