我想列出 Azure 中所有具有公共 IP 地址的负载均衡器,但我只得到一个子集而不是整个结果。 var credentials = SdkContext.AzureCredentialsFactory .FromServicePrincipal(clientId, secret, tenantId, AzureEnvironment.AzureGlobalCloud);var azure = Microsoft.Azure.Management.Fluent.Azure .Configure() .Authenticate(credentials).WithDefaultSubscription();foreach (var subscription in azure.Subscriptions.List()){ var loadbalancers = azure.LoadBalancers; foreach (var loadbalancer in loadbalancers.List()) { if (loadbalancer.PublicFrontends.Count >= 1) { writelog("load balancer:" + loadbalancer.Name); } }}
添加回答
举报
0/150
提交
取消