The problem is that you are asking a virtual machine to do the job of a web
app, which Azure does not allow.
One solution is to create a web app instead of creating a virtual machine. Another is to separate TensorFlow from TensorBoard, running the first on the virtual machine and the second on your local machine, periodically copying back the files that TensorBoard uses.
Web app solution
Build an image and push it to DockerHub or similar. These commands require you to have and authenticate a DockerHub account:
docker build -t docker_username/image_name:image_tag -f DOCKERFILE .
docker login
docker push docker_username/image_name:image_tag
Create a web app on the Azure portal by clicking on "Create a resource", searching for "web app", and choosing one provider, such as "Web App" by Microsoft. Click "Create", then in the new blade that shows at the left, under "Publish" switch the toggle to "Docker Image", then under "Single container" and in the field "Image and optional tagwrite
docker_username/image_name:image_tag`.
In this solution, take note that Azure web sites do not have port 6006 open, which
TensorBoard uses, so see this thread to redirect port 6006 to port 80.
Virtual machine + local machine solution
The advantage of this solution is that you have more control over the virtual
machine, e.g. you can specify a GPU enabled virtual machine to speed up TensorFlow, which you cannot do that with an App Service Plan as of yet.
Create the virtual machine as you did, then run TensorFlow on it. Then periodically copy back the files from the container to the virtual machine and
then from the virtual machine to your local machine.
Assuming that the Azure IP is 0.0.0.0, that you have only one container running, and that you have your
results in /tmp/vae
(for variational auto-encoder), the commands to copy back the files are:
ssh username@0.0.0.0 'docker cp $(docker container ls | tail -n 1 | cut -d " " -f 1):/tmp/vae vae'
scp -r username@0.0.0.0:vae /tmp/vae;
You can also run the two in a single line for an easy "arrow-up" repetition of command:
ssh username@0.0.0.0 'docker cp $(docker container ls | tail -n 1 | cut -d " " -f 1):/tmp/vae vae';scp -r username@0.0.0.0:vae /tmp/vae
Then launch TensorBoard from your local machine in another shell:
tensorboard --logdir=/tmp/vae/