Showing posts with label vm. Show all posts
Showing posts with label vm. Show all posts

4/16/2014

Remote Web Deployment to Azure VM

Visual Studio Environment offers different types of web-site publish. One of them is Web Deployment. This option allows user to directly publish application to a server IIS remotely. However there are steps to be followed before using this feature:

  1. Install web deploy in the Azure VM. You need to choose full installation, the deployment related service will automatically be started( or you can run the command net start msdepsvc) Link http://technet.microsoft.com/en-us/library/dd569059(v=WS.10).aspx
  2. Default port for web deploy is 8172. You can either choose to use it or define your own port. You can set this port via IIS> Click Server> Management Service ( you need to stop service to configure)
  3. Add endpoint using Azure Portal. Click Virtual Machine and select your machine. Click endpoints and add new TCP endpoint, both public and private ports should be 8172
  4. Right click your project and click publish. Choose Web Deploy. In your server settings, server name should be your virtual machine path with 8172 port. 

3/03/2014

How to change VM image region (affinity group) in Microsoft Azure

Today, we needed to create a new virtual machine using an existing image in a different region that we worked so far. Due to the fact that images are region specific,we followed the steps above to create the VM:

  • Find the blob URL using Azure Portal. In VM section, there exists three tabs. One of them is images.Click this tab and find your image. Then look at image blob URL( i will call it source blob URL)
  • Create a storage and container in the region that you want to use image if you didnt do. I will call this container as destination base URL
  • Install Microsoft Azure Storage tools. It will be used to copy blob vhd item from one container to another. In current Azure Portal, there is no option to copy blob items. You can also do this by downloading the  vhd and upload it again manually.
azure account import {file path for publishsettings} (you can download publishsettings via shellscript,see next step)
azure vm disk upload {source url} {destination url} {destination storage password}

  •  Install Microsoft Azure ShellScript. It will be used to register your blob as an image.After you execute the command,operating system will be asked, write operating system that the image contains. For my case it was "windows".
 add-azureaccount 
get-azurepublishsettingsfile 
import-azurepublishsettingsfile {file path for downloaded publishsettings}
add-azureVMImage -ImageName {image name} -MediaLocation {destination url} -Label {label of image }