I am using the Azure .NET SDK in C# to instantiate a VM of size NC4as_T4_v3. The problem that I am running into is that I need to define a VirtualMachineHardwareProfile object with a property VmSize of type VirtualMachineSizeType, but the enumeration VirtualMachineSizeType doesn't list the VM size I want.
Why? And can I define the Hardware Profile differently so as to instantiate this specific size?
A snippet of the code that I would like to use looks like this:
VirtualMachineData input = new VirtualMachineData(AzureLocation.EastUS)
{
HardwareProfile = new VirtualMachineHardwareProfile()
{
VmSize = VirtualMachineSizeType.Standard_NC4as_T4_v3
}
}
CodePudding user response:
As per the Microsoft documentation, there is no Virtual Machine of size Standard_NC4as_T4_v3
In the VirtualMachineSizeType property/Object so it does not list the specified size of VM.
You can use the other fields/sizes to instantiate, which are mentioned in the above document.
CodePudding user response:
In the end I have chose to create an ARM template using Bicep. Using the Azure SDK in my C# application to deploy the template to Azure.
This sample code gives an example of how to deploy an ARM template using Azure .NET SDK.
By using the Bicep/ARM I am able to define any and all properties of the VM that I want to use.