0

我们如何获得使用c#创建Azure vm的域名..只是想知道是否有任何api...

试过了

ComputeManagementClient.Deployments.GetBySlot

但返回DeploymentGetResponse没有域信息

4

1 回答 1

0

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;
于 2014-09-09T07:17:01.567 回答