Error when running CreateAzureVMFromPackerTemplate #5284
Unanswered
Malaw80s
asked this question in
General questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm seeing the error below when running these commands:
Set-Location C:\virtual-environments
Import-Module .\helpers\CreateAzureVMFromPackerTemplate.ps1
CreateAzureVMFromPackerTemplate -SubscriptionId {MY SUBSCRIPTION ID} -ResourceGroupName "MY RESOURCE GROUP NAME" -TemplateFile "C:\BuildVmImages\temporaryTemplate.json" -VirtualMachineName "MY VM NAME" -AdminUsername "MY USER NAME" -AdminPassword "MY PASSWORD" -AzureLocation "eastus"
I tried multiple times and always came back with the same error. I'm am copying and pasting the SUBSCRIPTION ID directly from Azure Portal.
Error:
Creating a virtual network and subnet
WARNING: Subscription '{MY SUBSCRIPTION ID}' not recognized.
ERROR: Subscription '{MY SUBSCRIPTION ID}' not found. Check the spelling and casing and try again.
Cannot index into a null array.
At C:\virtual-environments\helpers\CreateAzureVMFromPackerTemplate.ps1:59 char:5
Creating a network interface controller (NIC)
ERROR: argument --subnet: expected one argument
Examples from AI knowledge base:
az network nic create --resource-group MyResourceGroup --vnet-name MyVnet --subnet MySubnet --name MyNic
Create a network interface for a specified subnet on a specified virtual network.
az network nic create --resource-group MyResourceGroup --vnet-name MyVnet --subnet MySubnet --name MyNic --ip-forwarding --network-security-group MyNsg
Create a network interface for a specified subnet on a virtual network which allows
IP forwarding subject to a network security group.
https://docs.microsoft.com/en-US/cli/azure/network/nic#az_network_nic_create
Read more about the command in reference docs
Creating a public IP address
WARNING: Subscription '{MY SUBSCRIPTION ID}' not recognized.
WARNING: [Coming breaking change] In the coming release, the default behavior will be changed as follows when sku is Standard and zone is not provided: For zonal regions, you will get a zone-redundant IP indicated by zones:["1","2","3"]; For non-zonal regions, you will get a non zone-redundant IP indicated by zones:null.
ERROR: Subscription '{MY SUBSCRIPTION ID}' not found. Check the spelling and casing and try again.
Adding the public IP to the NIC
argument --public-ip-address: expected one argument
Examples from AI knowledge base:
az network nic ip-config update --name MyIpConfig --nic-name MyNic --public-ip-address MyAppGatewayPublicIp --resource-group MyResourceGroup
Update an IP configuration. (autogenerated)
az network nic ip-config update --resource-group MyResourceGroup --nic-name MyNic --name MyIpConfig --private-ip-address 10.0.0.9
Update a NIC to use a new private IP address.
https://docs.microsoft.com/en-US/cli/azure/network/nic/ip-config#az_network_nic_ip_config_update
Read more about the command in reference docs
Creating the VM
Subscription '{MY SUBSCRIPTION ID}' not recognized.
This command is implicitly deprecated because command group 'group deployment' is deprecated and will be removed in a future release. Use 'deployment group' instead.
Subscription '{MY SUBSCRIPTION ID}' not found. Check the spelling and casing and try again.
Created in MoeAlawRsg:
vnet {SOME VNET}
subnet {SOME SUBNET}
nic {SOME NIC}
publicip {SOME PUBLICIP}
vm {SOME VM}
Beta Was this translation helpful? Give feedback.
All reactions