Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get success Response from Microsoft.Azure.Management.Fluent api method #1

Open
Pritik889 opened this issue Jun 27, 2018 · 0 comments

Comments

@Pritik889
Copy link

Pritik889 commented Jun 27, 2018

I have created Virtual machine on Azure portal via Fluent API class in c#. my c# code is:

public JsonResult createVM()
{
try
{
 IAzure azure = Authenticate(subscriptionId);
  azure.VirtualMachines.Define(vmName)
            .WithRegion(location)
            .WithExistingResourceGroup(ResourceGroupName)
            .WithExistingPrimaryNetworkInterface(networkInterface)
            .WithSpecializedOSDisk(managedDisk, operatingSystem)
            .WithSize(vmSize)
            .Create();
//Here i want complete response from above code..if success.
return Json(string.Empty);
}
 catch (CloudException ex)
            {
 Response.Write(ex.Response.Content);
                    return Json(string.Empty);
}
}

i get response in catch block if execution failed. but we need response if execution succeed .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant