Skip to content

Commit 6ae211c

Browse files
authored
Fix resource id env var (#37321)
* Fix resource id env var * fix scope * ga version is not live yet * ga version is not live yet * fix api version
1 parent 5794bcc commit 6ae211c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/MetricsBatchQueryServiceVersion.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public enum MetricsBatchQueryServiceVersion implements ServiceVersion {
1212
/**
1313
* The preview version of the Metrics Batch Query service.
1414
*/
15-
V2023_10_01("2023-10-01");
15+
V2023_05_01_PREVIEW("2023-05-01-preview");
1616

1717
private final String version;
1818

@@ -30,6 +30,6 @@ public String getVersion() {
3030
* @return the latest {@link MetricsBatchQueryServiceVersion}.
3131
*/
3232
public static MetricsBatchQueryServiceVersion getLatest() {
33-
return V2023_10_01;
33+
return V2023_05_01_PREVIEW;
3434
}
3535
}

sdk/monitor/azure-monitor-query/src/main/java/com/azure/monitor/query/implementation/metricsbatch/AzureMonitorMetricBatchBuilder.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ private HttpPipeline createHttpPipeline() {
301301
policies.add(ClientBuilderUtil.validateAndGetRetryPolicy(retryPolicy, retryOptions, new RetryPolicy()));
302302
policies.add(new AddDatePolicy());
303303
if (tokenCredential != null) {
304-
policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, String.format("%s/.default", endpoint)));
304+
policies.add(new BearerTokenAuthenticationPolicy(tokenCredential, "https://metrics.monitor.azure.com/.default"));
305305
}
306306
this.pipelinePolicies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
307307
.forEach(p -> policies.add(p));

sdk/monitor/azure-monitor-query/src/test/java/com/azure/monitor/query/MonitorQueryTestUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ private MonitorQueryTestUtils() {
1919
.get("AZURE_MONITOR_LOGS_RESOURCE_ID");
2020

2121
private static final String METRIC_RESOURCE_URI = Configuration.getGlobalConfiguration()
22-
.get("AZURE_MONITOR_METRICS_RESOURCE_URI");
22+
.get("AZURE_MONITOR_METRICS_RESOURCE_URI_1");
2323

2424

2525
public static final String QUERY_STRING = "let dt = datatable (DateTime: datetime, Bool:bool, Guid: guid, Int: "

0 commit comments

Comments
 (0)