Skip to content

Commit facfb86

Browse files
authored
Deprecate AZURE_GERMANY in Spring Cloud Azure (Azure#34682)
* deprecate `AZURE_GERMANY`
1 parent ffc96a8 commit facfb86

File tree

23 files changed

+82
-65
lines changed

23 files changed

+82
-65
lines changed

eng/code-quality-reports/src/main/resources/revapi/revapi.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@
230230
"code": "java\\.annotation\\.removed",
231231
"old": ".*? com\\.azure\\.search\\.documents(\\.indexes)?\\.models.*",
232232
"justification": "Removing Jackson annotations from Search in transition to stream-style."
233+
},
234+
{
235+
"code": "java.field.removed",
236+
"old": "field com.azure.spring.cloud.core.properties.profile.AzureEnvironmentProperties.AZURE_GERMANY",
237+
"justification": "Remove this because AZURE_GERMANY is deprecated."
233238
}
234239
]
235240
}

sdk/spring/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Release History
22

3+
## 4.8.0-beta.1 (unreleased)
4+
5+
### Spring Cloud Azure Core
6+
This section includes changes in `spring-cloud-azure-core`, `spring-cloud-azure-service`, and `spring-cloud-azure-resourcemanager` modules.
7+
8+
#### Breaking Changes
9+
- Deprecated `CloudType.AZURE_GERMANY`, `JDBC_SCOPE_AZURE_GERMANY`, `REDIS_SCOPE_AZURE_GERMANY`, `AzureEnvironmentProperties.AZURE_GERMANY` [#34682](https://github.com/Azure/azure-sdk-for-java/pull/34682).
10+
11+
### Spring Cloud Azure Autoconfigure
12+
This section includes changes in `spring-cloud-azure-autoconfigure` module.
13+
14+
#### Breaking Changes
15+
- Deprecated `SERVICE_BUS_SCOPE_AZURE_GERMANY` [#34682](https://github.com/Azure/azure-sdk-for-java/pull/34682).
16+
317
## 4.7.0 (2023-03-23)
418
- This release is compatible with Spring Boot 2.5.0-2.5.14, 2.6.0-2.6.14, 2.7.0-2.7.9. (Note: 2.5.x (x>14), 2.6.y (y>14) and 2.7.z (z>9) should be supported, but they aren't tested with this release.)
519
- This release is compatible with Spring Cloud 2020.0.3-2020.0.6, 2021.0.0-2021.0.5. (Note: 2020.0.x (x>6) and 2021.0.y (y>5) should be supported, but they aren't tested with this release.)

sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/aad/properties/AadProfileProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class AadProfileProperties {
1818
*/
1919
private String tenantId; // tenantId can not set to "common" here, otherwise we can not know whether it's set by customer or it is the default value.
2020
/**
21-
* Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.
21+
* Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.
2222
*/
2323
private AzureProfileOptionsProvider.CloudType cloudType;
2424
/**

sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/jms/properties/AzureServiceBusJmsProperties.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,17 @@ public class AzureServiceBusJmsProperties implements InitializingBean, Passwordl
3030

3131
private static final String SERVICE_BUS_SCOPE_AZURE = "https://servicebus.azure.net/.default";
3232
private static final String SERVICE_BUS_SCOPE_AZURE_CHINA = SERVICE_BUS_SCOPE_AZURE;
33+
/**
34+
* @deprecated AZURE_GERMANY is deprecated. Please use other Service Bus scopes.
35+
*/
36+
@Deprecated
3337
private static final String SERVICE_BUS_SCOPE_AZURE_GERMANY = SERVICE_BUS_SCOPE_AZURE;
3438
private static final String SERVICE_BUS_SCOPE_AZURE_US_GOVERNMENT = SERVICE_BUS_SCOPE_AZURE;
3539

3640
private static final Map<CloudType, String> SERVICEBUS_SCOPE_MAP = new HashMap<CloudType, String>() {
3741
{
3842
put(CloudType.AZURE, SERVICE_BUS_SCOPE_AZURE);
3943
put(CloudType.AZURE_CHINA, SERVICE_BUS_SCOPE_AZURE_CHINA);
40-
put(CloudType.AZURE_GERMANY, SERVICE_BUS_SCOPE_AZURE_GERMANY);
4144
put(CloudType.AZURE_US_GOVERNMENT, SERVICE_BUS_SCOPE_AZURE_US_GOVERNMENT);
4245
}
4346
};

sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/properties/core/profile/AzureProfileConfigurationProperties.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class AzureProfileConfigurationProperties extends AzureProfileOptionsAdap
2121
*/
2222
private String subscriptionId;
2323
/**
24-
* Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.
24+
* Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.
2525
*/
2626
private AzureProfileOptionsProvider.CloudType cloudType;
2727

sdk/spring/spring-cloud-azure-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1301,7 +1301,7 @@
13011301
{
13021302
"name": "spring.cloud.azure.keyvault.secret.property-sources[0].profile.cloud-type",
13031303
"type": "com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider$CloudType",
1304-
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
1304+
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
13051305
"sourceType": "com.azure.spring.cloud.autoconfigure.properties.core.profile.AzureProfileConfigurationProperties"
13061306
},
13071307
{
@@ -1590,7 +1590,7 @@
15901590
{
15911591
"name": "spring.datasource.azure.profile.cloud-type",
15921592
"type": "java.lang.String",
1593-
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
1593+
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
15941594
"sourceType": "com.azure.spring.cloud.service.implementation.passwordless.AzureJdbcPasswordlessProperties"
15951595
},
15961596
{
@@ -1658,7 +1658,7 @@
16581658
{
16591659
"name": "spring.redis.azure.profile.cloud-type",
16601660
"type": "java.lang.String",
1661-
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_GERMANY, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
1661+
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
16621662
"sourceType": "com.azure.spring.cloud.service.implementation.passwordless.AzureRedisPasswordlessProperties"
16631663
},
16641664
{

sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/eventhubs/AzureEventHubsAutoConfigurationTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void configureAzureEventHubsPropertiesWithGlobalDefaults() {
129129
@Test
130130
void configureEventHubsDomainNameOverrideGlobalDefault() {
131131
AzureGlobalProperties azureProperties = new AzureGlobalProperties();
132-
azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
132+
azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
133133

134134
this.contextRunner
135135
.withBean(AzureGlobalProperties.class, () -> azureProperties)
@@ -140,8 +140,8 @@ void configureEventHubsDomainNameOverrideGlobalDefault() {
140140
.run(context -> {
141141
assertThat(context).hasSingleBean(AzureEventHubsProperties.class);
142142
final AzureEventHubsProperties properties = context.getBean(AzureEventHubsProperties.class);
143-
assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
144-
assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName());
143+
assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
144+
assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName());
145145
assertThat(properties.getDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName());
146146
});
147147
}

sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/eventhubs/properties/AzureEventHubsPropertiesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ void getDomainNameFromCloud() {
7272
@Test
7373
void domainNameOverrideCloud() {
7474
AzureEventHubsProperties eventHubsProperties = new AzureEventHubsProperties();
75-
eventHubsProperties.setDomainName(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName());
75+
eventHubsProperties.setDomainName(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName());
7676
eventHubsProperties.getProfile().setCloudType(AZURE_CHINA);
77-
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(),
77+
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(),
7878
eventHubsProperties.getDomainName());
7979
}
8080

sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/implementation/servicebus/properties/AzureServiceBusPropertiesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ void getDomainNameFromCloud() {
6969
@Test
7070
void domainNameOverrideCloud() {
7171
AzureServiceBusProperties serviceBusProperties = new AzureServiceBusProperties();
72-
serviceBusProperties.setDomainName(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName());
72+
serviceBusProperties.setDomainName(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName());
7373
serviceBusProperties.getProfile().setCloudType(AZURE_CHINA);
74-
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(),
74+
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(),
7575
serviceBusProperties.getDomainName());
7676
}
7777

sdk/spring/spring-cloud-azure-autoconfigure/src/test/java/com/azure/spring/cloud/autoconfigure/redis/AzureJedisPasswordlessAutoConfigurationTest.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,6 @@ void testScopes() {
6565
Assertions.assertEquals(REDIS_SCOPE_CHINA, properties.getScopes());
6666
});
6767

68-
this.contextRunner.withPropertyValues("spring.redis.azure.profile.cloud-type = AZURE_GERMANY").run((context) -> {
69-
AzureRedisPasswordlessProperties properties = context.getBean(AzureRedisPasswordlessProperties.class);
70-
Assertions.assertEquals(REDIS_SCOPE_GERMANY, properties.getScopes());
71-
});
72-
7368
this.contextRunner.withPropertyValues("spring.redis.azure.profile.cloud-type = AZURE_US_GOVERNMENT").run((context) -> {
7469
AzureRedisPasswordlessProperties properties = context.getBean(AzureRedisPasswordlessProperties.class);
7570
Assertions.assertEquals(REDIS_SCOPE_US_GOVERNMENT, properties.getScopes());

0 commit comments

Comments
 (0)