How can we get the domain name on which the Azure vm is created using c#.. just would like to know if there is any api...
tried
ComputeManagementClient.Deployments.GetBySlot
but that returns DeploymentGetResponse
which doesnt have domain info
How can we get the domain name on which the Azure vm is created using c#.. just would like to know if there is any api...
tried
ComputeManagementClient.Deployments.GetBySlot
but that returns DeploymentGetResponse
which doesnt have domain info
Now that you have described in little more details what you are trying to achieve, you need the domain under which the VM is joined but not under which the VM is deployed. Because your AD certainly does not have control over *.cloudapp.net. And your mapped public domain may be different from your AD Domain.
Following this SO question, you can get the Domain to which the VM is joined executing the following code on the VM itself:
System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;