Azure 资源管理器
Azure resourceManager
我正在尝试以编程方式扩展 Azure 辅助角色,但找不到资源名称的正确语法。
// Create the autoscale client.
AutoscaleClient autoscaleClient = new AutoscaleClient(new CertificateCloudCredentials(subscriptionId, cert));
AutoscaleSettingGetResponse get =autoscaleClient.Settings.Get(AutoscaleResourceIdBuilder.BuildCloudServiceResourceId("WRK-GROUP-NE01","CIW.GROUPS",true) );
AutoscaleSetting setting = get.Setting;
它returns : ResourceNotFound: 不支持资源服务名称监控。
你能告诉我正确的语法吗?
您所遵循的指南基于 Azure 服务管理模型,也称为经典模式,该模型已弃用,主要用于向后兼容支持。
您应该使用最新的 Microsoft.Azure.Insights nuget 包来获取自动缩放设置。
使用上述nuget的示例代码如下:
using Microsoft.Azure.Management.Insights;
using Microsoft.Rest;
//... Get necessary values for the required parameters
var client = new InsightsManagementClient(new TokenCredentials(token));
client.AutoscaleSettings.Get(resourceGroupName, autoScaleSettingName);
请参阅下面的 REST API 参考以获取自动缩放设置。
GET
https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/autoscaleSettings/{autoscale-setting-name}?api-version={api-version}
要更新自动销售设置,您可以使用以下 api
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}?api-version=2015-04-01
https://docs.microsoft.com/en-us/rest/api/monitor/autoscalesettings/createorupdate
希望对您有所帮助。
我正在尝试以编程方式扩展 Azure 辅助角色,但找不到资源名称的正确语法。
// Create the autoscale client.
AutoscaleClient autoscaleClient = new AutoscaleClient(new CertificateCloudCredentials(subscriptionId, cert));
AutoscaleSettingGetResponse get =autoscaleClient.Settings.Get(AutoscaleResourceIdBuilder.BuildCloudServiceResourceId("WRK-GROUP-NE01","CIW.GROUPS",true) );
AutoscaleSetting setting = get.Setting;
它returns : ResourceNotFound: 不支持资源服务名称监控。 你能告诉我正确的语法吗?
您所遵循的指南基于 Azure 服务管理模型,也称为经典模式,该模型已弃用,主要用于向后兼容支持。
您应该使用最新的 Microsoft.Azure.Insights nuget 包来获取自动缩放设置。
使用上述nuget的示例代码如下:
using Microsoft.Azure.Management.Insights;
using Microsoft.Rest;
//... Get necessary values for the required parameters
var client = new InsightsManagementClient(new TokenCredentials(token));
client.AutoscaleSettings.Get(resourceGroupName, autoScaleSettingName);
请参阅下面的 REST API 参考以获取自动缩放设置。
GET
https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/microsoft.insights/autoscaleSettings/{autoscale-setting-name}?api-version={api-version}
要更新自动销售设置,您可以使用以下 api
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/microsoft.insights/autoscalesettings/{autoscaleSettingName}?api-version=2015-04-01
https://docs.microsoft.com/en-us/rest/api/monitor/autoscalesettings/createorupdate
希望对您有所帮助。