I am trying to set environment variable in virtual machine using custom extension but i am not able to do so.
I created a script.sh file with following content
#!/bin/bash
if [ -z "$hiddencode" ]
then
echo "Setting user information"
echo "export hiddencode=213452314">>~/.profile
echo "export hiddencode=213452314">>~/.bashrc
. ~/.bashrc
. ~/.profile
else
echo "information is already present"
fi
exit
The deployment itself fails saying cannot create ~/.profile: Directory nonexistent
The command used to run script is "sh script.sh"
How do I set environment variable using custom extension for linux in azure