Skip to main content

Mange Azure Using Power Shell Scripts

Here are a few Power Shell Scripts that are handy in speeding up things even further in terms of Provisioning, Starting up or Stopping a Virtual Machine.
How to Provision a Virtual Machine using our custom Image?
# The VM, Service, and Image Name's
$vmName = "myFirstVM"
$svcName = "myCloudService"
$imageName = "myImage"
# Setup the New Azure VM Configurations
$newVM = New-AzureVMConfig -Name $vmName -InstanceSize $instanceSize -ImageName $imageName
$newVM | Add-AzureEndpoint -Name 'Remote Desktop' -Protocol tcp -LocalPort 3389 -PublicPort 51000
$newVM | Add-AzureEndpoint -Name 'PowerShell' -Protocol tcp -LocalPort 5986 -PublicPort 5986
# Create the new Azure Cloud Service
$checkNewAS = New-AzureService -ServiceName $svcName -Location $location -Label $svcName
# Create the new Azure VM
$checkNewAVM = New-AzureVM -ServiceName $svcName -Location $location -VMs $newVM

How to Start Up a Virtual Machine?
$start = Start-AzureVM -Name $vmName -ServiceName $svcName
How to Stop a Virtual Machine?
$stop = Stop-AzureVM -Name $vmName -ServiceName $svcName
Important:
  • Download and Install the Azure Power Shell SDK, for the above to workhttp://azure.microsoft.com/en-in/downloads/
  • Add your Azure Account to Power Shell Via:$cred = Get-CredentialAdd-AzureAccount -Credential $cred​

Comments

Post a Comment

Popular posts from this blog

Everything about Java 8

The following post is a comprehensive summary of the developer-facing changes coming in Java 8. This next iteration of the JDK is currently scheduled for general availability in  September 2013 . Read More

Hands-on with Mozilla’s Web-based “Firefox OS” for smartphones

Launching a new mobile OS is a difficult project since the market leaders, Android and iOS, have such  a big lead. Even Microsoft, with its near-infinite financial resources and vast ecosystem of complementary products, has struggled to gain traction. And new entrants face a chicken-and-egg problem: developers don't want to write apps for a platform without many users, while users don't want to buy a phone without many apps. Mozilla, the non-profit foundation behind Firefox, believes it can tackle this dilemma. In 2011, it announced a new project  called Boot2Gecko to build an operating system around its browser. Last year the project was  re-branded Firefox OS, and Mozilla began preparations for a major push into the mobile phone market. In February, Mozilla  unveiled an impressive initial list  of hardware and network partners. If all goes according to plan, Firefox OS phones will be available in a number of countries, mostly in the developing world, la...

Google leaps language barrier with translator phone

GOOGLE is developing software for the first phone capable of translating foreign languages almost instantly — like the Babel Fish in The Hitchhiker’s Guide to the Galaxy. By building on existing technologies in voice recognition and automatic translation, Google hopes to have a basic system ready within a couple of years. If it works, it could eventually transform communication among speakers of the world’s 6,000-plus languages. The company has already created an automatic system for translating text on computers, which is being honed by scanning millions of multi-lingual websites and documents. So far it covers 52 languages, adding Haitian Creole last week. Google also has a voice recognition system that enables phone users to conduct web searches by speaking commands into their phones rather than typing them in. Now it is working on combining the two technologies to produce software capable of understanding a caller’s voice and translating it into a synthetic equivalent in a foreign ...