Azure Monitor: Remove references to Germany cloud (#60588)

This commit is contained in:
Andres Martinez Gotor 2022-12-21 11:51:57 +01:00 committed by GitHub
parent 2533b44cb6
commit 733dbe0163
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 7 additions and 25 deletions

View File

@ -110,11 +110,10 @@ 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` |
### Configure Managed Identity

View File

@ -15,7 +15,6 @@ const (
azureMonitorPublic = "azuremonitor"
azureMonitorChina = "chinaazuremonitor"
azureMonitorUSGovernment = "govazuremonitor"
azureMonitorGermany = "germanyazuremonitor"
azureMonitorCustomized = "customizedazuremonitor"
)

View File

@ -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",
})

View File

@ -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"},

View File

@ -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(),

View File

@ -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[];

View File

@ -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.');
}

View File

@ -26,7 +26,6 @@ export enum AzureCloud {
Public = 'AzureCloud',
China = 'AzureChinaCloud',
USGovernment = 'AzureUSGovernment',
Germany = 'AzureGermanCloud',
None = '',
}

View File

@ -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';

View File

@ -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(),