Stupid mistake... the code to call my method was missing an await.
Creating virtual machine through c# SDK kills process
I'm working on a console application using the Azure C# SDK (Azure.ResourceManager.Compute version 1.5.0.0) to create a virtual machine.
I have the following objects, both of which are not null:
private readonly ResourceGroupResource _resourceGroup;
var vmCollection = _resourceGroup.GetVirtualMachines();
The problem occurs when I execute the following command:
var response = await vmCollection.CreateOrUpdateAsync(WaitUntil.Completed, name, vmData);
The VM is created successfully, but the console application immediately exits afterward, even though there are additional lines of code to execute. Using Fiddler to monitor the network traffic shows that the result of the call is HTTP/1.1 201.
Has anyone encountered this issue or know how to prevent the console app from terminating after the VM creation?