From 733dbe016318e0f5e37ab53f5c1ddbf1ef97e1d9 Mon Sep 17 00:00:00 2001 From: Andres Martinez Gotor Date: Wed, 21 Dec 2022 11:51:57 +0100 Subject: [PATCH] Azure Monitor: Remove references to Germany cloud (#60588) --- docs/sources/datasources/azure-monitor/_index.md | 11 +++++------ pkg/tsdb/azuremonitor/credentials.go | 1 - pkg/tsdb/azuremonitor/credentials_test.go | 4 ++-- pkg/tsdb/azuremonitor/routes.go | 6 ------ .../components/AzureCredentialsForm.test.tsx | 1 - .../components/MonitorConfig.tsx | 1 - .../grafana-azure-monitor-datasource/credentials.ts | 4 ---- .../grafana-azure-monitor-datasource/types/types.ts | 1 - .../prometheus/configuration/AzureCredentials.ts | 2 -- .../configuration/AzureCredentialsForm.test.tsx | 1 - 10 files changed, 7 insertions(+), 25 deletions(-) diff --git a/docs/sources/datasources/azure-monitor/_index.md b/docs/sources/datasources/azure-monitor/_index.md index ea4ba6753f2..e2bc062d163 100644 --- a/docs/sources/datasources/azure-monitor/_index.md +++ b/docs/sources/datasources/azure-monitor/_index.md @@ -109,12 +109,11 @@ datasources: #### Supported cloud names -| Azure Cloud | `cloudName` Value | -| ---------------------------------------------------- | -------------------------- | -| **Microsoft Azure public cloud** | `azuremonitor` (_Default_) | -| **Microsoft Chinese national cloud** | `chinaazuremonitor` | -| **US Government cloud** | `govazuremonitor` | -| **Microsoft German national cloud ("Black Forest")** | `germanyazuremonitor` | +| Azure Cloud | `cloudName` Value | +| ------------------------------------ | -------------------------- | +| **Microsoft Azure public cloud** | `azuremonitor` (_Default_) | +| **Microsoft Chinese national cloud** | `chinaazuremonitor` | +| **US Government cloud** | `govazuremonitor` | ### Configure Managed Identity diff --git a/pkg/tsdb/azuremonitor/credentials.go b/pkg/tsdb/azuremonitor/credentials.go index ee5ea290326..d5ccdb00a61 100644 --- a/pkg/tsdb/azuremonitor/credentials.go +++ b/pkg/tsdb/azuremonitor/credentials.go @@ -15,7 +15,6 @@ const ( azureMonitorPublic = "azuremonitor" azureMonitorChina = "chinaazuremonitor" azureMonitorUSGovernment = "govazuremonitor" - azureMonitorGermany = "germanyazuremonitor" azureMonitorCustomized = "customizedazuremonitor" ) diff --git a/pkg/tsdb/azuremonitor/credentials_test.go b/pkg/tsdb/azuremonitor/credentials_test.go index 9c241ac5dfe..16b16c04602 100644 --- a/pkg/tsdb/azuremonitor/credentials_test.go +++ b/pkg/tsdb/azuremonitor/credentials_test.go @@ -88,7 +88,7 @@ func TestCredentials_getAzureCloud(t *testing.T) { t.Run("when auth type is managed identity", func(t *testing.T) { jsonData := simplejson.NewFromAny(map[string]interface{}{ "azureAuthType": azcredentials.AzureAuthManagedIdentity, - "cloudName": azureMonitorGermany, + "cloudName": azureMonitorUSGovernment, }) t.Run("should be from server configuration regardless of datasource value", func(t *testing.T) { @@ -153,7 +153,7 @@ func TestCredentials_getAzureCredentials(t *testing.T) { t.Run("when auth type is managed identity", func(t *testing.T) { jsonData := simplejson.NewFromAny(map[string]interface{}{ "azureAuthType": azcredentials.AzureAuthManagedIdentity, - "cloudName": azureMonitorGermany, + "cloudName": azureMonitorUSGovernment, "tenantId": "9b9d90ee-a5cc-49c2-b97e-0d1b0f086b5c", "clientId": "849ccbb0-92eb-4226-b228-ef391abd8fe6", }) diff --git a/pkg/tsdb/azuremonitor/routes.go b/pkg/tsdb/azuremonitor/routes.go index ae1b2b5da9f..0a57915a1e8 100644 --- a/pkg/tsdb/azuremonitor/routes.go +++ b/pkg/tsdb/azuremonitor/routes.go @@ -25,12 +25,6 @@ var azUSGovManagement = types.AzRoute{ Headers: map[string]string{"x-ms-app": "Grafana"}, } -var azGermanyManagement = types.AzRoute{ - URL: "https://management.microsoftazure.de", - Scopes: []string{"https://management.microsoftazure.de/.default"}, - Headers: map[string]string{"x-ms-app": "Grafana"}, -} - var azChinaManagement = types.AzRoute{ URL: "https://management.chinacloudapi.cn", Scopes: []string{"https://management.chinacloudapi.cn/.default"}, diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AzureCredentialsForm.test.tsx b/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AzureCredentialsForm.test.tsx index b717cad9fef..367af9ebccb 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AzureCredentialsForm.test.tsx +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/AzureCredentialsForm.test.tsx @@ -19,7 +19,6 @@ const setup = (propsFunc?: (props: Props) => Props) => { azureCloudOptions: [ { value: 'azuremonitor', label: 'Azure' }, { value: 'govazuremonitor', label: 'Azure US Government' }, - { value: 'germanyazuremonitor', label: 'Azure Germany' }, { value: 'chinaazuremonitor', label: 'Azure China' }, ], onCredentialsChange: jest.fn(), diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/MonitorConfig.tsx b/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/MonitorConfig.tsx index 3f92cea8f1c..eeba7a88183 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/MonitorConfig.tsx +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/components/MonitorConfig.tsx @@ -11,7 +11,6 @@ import { AzureCredentialsForm } from './AzureCredentialsForm'; const azureClouds = [ { value: 'azuremonitor', label: 'Azure' }, { value: 'govazuremonitor', label: 'Azure US Government' }, - { value: 'germanyazuremonitor', label: 'Azure Germany' }, { value: 'chinaazuremonitor', label: 'Azure China' }, ] as SelectableValue[]; diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/credentials.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/credentials.ts index c7f73be3795..bd5fb9139b0 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/credentials.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/credentials.ts @@ -37,8 +37,6 @@ function getDefaultAzureCloud(): string { return 'chinaazuremonitor'; case AzureCloud.USGovernment: return 'govazuremonitor'; - case AzureCloud.Germany: - return 'germanyazuremonitor'; default: throw new Error(`The cloud '${config.azure.cloud}' not supported.`); } @@ -52,8 +50,6 @@ export function getAzurePortalUrl(azureCloud: string): string { return 'https://portal.azure.cn'; case 'govazuremonitor': return 'https://portal.azure.us'; - case 'germanyazuremonitor': - return 'https://portal.microsoftazure.de'; default: throw new Error('The cloud not supported.'); } diff --git a/public/app/plugins/datasource/grafana-azure-monitor-datasource/types/types.ts b/public/app/plugins/datasource/grafana-azure-monitor-datasource/types/types.ts index 13d4c9902db..04879f9c8e4 100644 --- a/public/app/plugins/datasource/grafana-azure-monitor-datasource/types/types.ts +++ b/public/app/plugins/datasource/grafana-azure-monitor-datasource/types/types.ts @@ -26,7 +26,6 @@ export enum AzureCloud { Public = 'AzureCloud', China = 'AzureChinaCloud', USGovernment = 'AzureUSGovernment', - Germany = 'AzureGermanCloud', None = '', } diff --git a/public/app/plugins/datasource/prometheus/configuration/AzureCredentials.ts b/public/app/plugins/datasource/prometheus/configuration/AzureCredentials.ts index 268e18f1e73..7ca0a69f064 100644 --- a/public/app/plugins/datasource/prometheus/configuration/AzureCredentials.ts +++ b/public/app/plugins/datasource/prometheus/configuration/AzureCredentials.ts @@ -4,7 +4,6 @@ export enum AzureCloud { Public = 'AzureCloud', China = 'AzureChinaCloud', USGovernment = 'AzureUSGovernment', - Germany = 'AzureGermanCloud', None = '', } @@ -12,7 +11,6 @@ export const KnownAzureClouds = [ { value: AzureCloud.Public, label: 'Azure' }, { value: AzureCloud.China, label: 'Azure China' }, { value: AzureCloud.USGovernment, label: 'Azure US Government' }, - { value: AzureCloud.Germany, label: 'Azure Germany' }, ] as SelectableValue[]; export type AzureAuthType = 'msi' | 'clientsecret'; diff --git a/public/app/plugins/datasource/prometheus/configuration/AzureCredentialsForm.test.tsx b/public/app/plugins/datasource/prometheus/configuration/AzureCredentialsForm.test.tsx index 70d3e0ac3ca..384a5782064 100644 --- a/public/app/plugins/datasource/prometheus/configuration/AzureCredentialsForm.test.tsx +++ b/public/app/plugins/datasource/prometheus/configuration/AzureCredentialsForm.test.tsx @@ -17,7 +17,6 @@ const setup = (propsFunc?: (props: Props) => Props) => { azureCloudOptions: [ { value: 'azuremonitor', label: 'Azure' }, { value: 'govazuremonitor', label: 'Azure US Government' }, - { value: 'germanyazuremonitor', label: 'Azure Germany' }, { value: 'chinaazuremonitor', label: 'Azure China' }, ], onCredentialsChange: jest.fn(),