Howdy! Trying to setup some IAC on Azure, and the...
# azure
t
Howdy! Trying to setup some IAC on Azure, and the basic example of turning on a VM at https://www.pulumi.com/registry/packages/azure/api-docs/compute/virtualmachine/ is broken in the python example. The line
Copy code
virtual_network_name=azurerm_virtual_network["example"]["name"],
refers to a variable that doesn't exist.
Maybe the "native" Azure API example works? Any pointers to working examples of how to turn on a VM in Azure using Python?
m
Hi Leo, apologies for the incorrect example! Regarding the note at the beginning of the
VirtualMachine
docs:
The
azure.compute.VirtualMachine
resource has been superseded by the
azure.compute.LinuxVirtualMachine
and
azure.compute.WindowsVirtualMachine
resources
maybe you’ll have better luck with one of these two? I see
virtual_network_name
looks better here: https://www.pulumi.com/registry/packages/azure/api-docs/compute/windowsvirtualmachine/ We also have a recent full example in form of a template. This is what you get when you run
pulumi new vm-azure-python
but you can also just take it directly from Github. https://github.com/pulumi/templates/blob/master/vm-azure-python/__main__.py