Reputation:
I have been working on windows bash and tried to pass the cloud init file, unfortunately i can not access the app through web, below is the reference..
"https://learn.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-automate-vm-deployment"
Upvotes: 2
Views: 1111
Reputation: 12788
You can use any editor you wish from “Linux text editors” to create cloud-init.txt file locally.
I used nano editor to create cloud-init.txt file as follows:
nano cloud-init.txt
Copy and paste content mentioned in the document mentioned.
Ctrl+X to save and press Y;
Now use az login to sign-in, if you have not install azure cli 2.0 you may refer “Install Azure CLI 2.0 with apt”.
az login
Now create a VM with –custom-data as follows:
az vm create --resource-group myResourceGroupAutomate --name myVM --image UbuntuLTS --admin-username azureuser --generate-ssh-keys --custom-data /root/cloud-init.txt
To allow web traffic to reach your VM, open port 80 from the Internet with az vm open-port:
az vm open-port --port 80 --resource-group myResourceGroupAutomate --name MyVM
Test web app:
Upvotes: 1