2
votes

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://docs.microsoft.com/en-us/azure/virtual-machines/linux/tutorial-automate-vm-deployment"

1
@Pradeep thanks, i am on windows bash system, when i checked my cloud_init.txt file i got below neo@dcadmin:/mnt/c/Users/dcadmin$ ls -lrth | grep cloud_init.txt ls: cannot read symbolic link 'Application Data': Permission denied ls: cannot read symbolic link 'Cookies': Permission denied ls: cannot read symbolic link 'Local Settings': Permission denied -rwxrwxrwx 1 root root 1.1K May 21 11:08 cloud_init.txtuser8286671
@Pradeep Thanks, i believe that i was on path /mnt/c/user/dcadmin which could be causing the problem, i had changed to /home/user created the cloud-init file and it worked.user8286671
now the problem seems to have ssh access to the server "Resource temporarily unavailable" debug1: connect to address xxx.xx.xx.xxx port 22: Resource temporarily unavailableuser8286671

1 Answers

1
votes

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;

enter image description here

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

enter image description here

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

enter image description here

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:

enter image description here