6

As we know that a new feature called virtual machine has been added in windows azure portal. but i want to create a virtual machine in windows azure programmatically with C# or . net. so can any one please help in this... which API shoud i use or yet the API for .net need to be published by azure people? please any one guide me to do this task.

4 Answers 4

6

You'll likely want to use Azure's REST Service Management APIs. For example, APIs for creating and managing VMs are here: Create Virtual Machine Deployment.

The overall API is documented here.

Since you're in .NET it seems like there would be service management APIs in the managed SDK, but I didn't see any service management API references there.

Sign up to request clarification or add additional context in comments.

1 Comment

i cheked those links but it consists of some xmls coding.... i tried with windows azure powershell.. i m able to create a virtual machine in azure with powershell commands but i want to invoke those commands in c# code to create a vm and power on and power off. can u help in that? here is the link for windows azure power shell:michaelwasham.com/2012/06/08/…
2

I just want to add something after the above answers, certainly you can create the Virtual Machines using Power Shell or C# and here is an example I found it might be interesting using the .Net API

http://code.msdn.microsoft.com/windowsazure/How-to-program-control-838bd90b

Comments

1

Currently there is only a REST API for creating Virtual Machines

This post shows an example of how to call the REST API in C# for creating a VM. Remember that a Virtual Machine and a VMRole are different.

Comments

1

Apologies for not having seen this question earlier. The Microsoft Azure Management Libraries (MAML, for short) can provide this sort of .NET-based access to the Microsoft Azure management APIs. MAML is available as a series of NuGet packages, which were released officially just this week.

To accompany the release I've put out a blog post linking to a VS Extension I wrote for the //build/ conference. This extension provides a walk-thru via VS Project & Item templates, along with some code snippets, that do exactly what you're after - create a VM in Microsoft Azure from a Console Application.

I've written a few other posts on MAML that offer other pieces of guidance and information. Hope this helps!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.