The title says it all. I've tried lots of things but I don't think any of them are worth mentioning. I have finally figured out to avoid Microsoft.WindowsAzure and have installed the Microsoft.Azure.Management.Compute and Microsoft.Azure.Common libraries.
I've finally got an authentication token like this:
var authenticationContext = new AuthenticationContext("https://login.windows.net/deadbeef-beef-beef-beef-ec74557498e8");
var credential = new ClientCredential("beefbeef-beef-beef-beef-b1d3cf5d037d", "passwordpasswordpasswordpasswordpasswordpas=");
var result = authenticationContext.AcquireTokenAsync("https://www.url.com/servicename", credential);
But now I'm struggling to use the documentation to learn to power on my VMs. I'm not even sure exactly where to start. All I know is I'd like to avoid the REST API and keep my code in C#. I'm looking for something like:
using (var client = new ComputeManagementClient(creds)) {
foreach (var vm in client.VMs)
{
Console.WriteLine("Starting VM: {0}", vm.Name);
vm.PowerOn();
}
}