如何以编程方式缩放 Azure 云服务(经典)角色

时间:2021-04-09 13:26:25

标签: azure azure-cloud-services azure-management-api

基于此如何以编程方式扩展 Azure 应用服务: Is it possible to scale Azure app services programmatically, 我正在尝试使用 Azure.Management.Compute.ComputeManagementClient 为 Azure 云服务(经典)重新创建它。

这是我目前所拥有的。它在一定程度上有效,但我永远无法从 API 中列出我的云服务:

Dim credentials = SdkContext.AzureCredentialsFactory.FromServicePrincipal(Client_Id, clientSecret, tenant_Id, AzureEnvironment.AzureGlobalCloud)
Dim client = New Microsoft.Azure.Management.Compute.ComputeManagementClient(credentials)
client.SubscriptionId = subscription_id
Dim servicesclient = client.CloudServices
Dim cloudservices = servicesclient.ListWithHttpMessagesAsync("MyResourceGroupName").Result.Body

到目前为止,一切似乎都按预期工作。如果我输入了错误 资源组名称,则会收到资源组不存在的错误消息。但是当我输入正确资源组名称时,预期的云服务列表返回空。尽管我已经相当仔细地检查过,但可能存在某种许可问题。还是这里的 CloudServices API 与我的“经典”云服务不同?或者还有什么我遗漏的吗?

0 个答案:

没有答案