Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions sdk/spring/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ This section includes changes in `spring-cloud-azure-stream-binder-eventhubs` mo
### Spring Cloud Azure Native Reachability
This library is deprecated, and all the reachability metadata have been incorporated into each Spring Cloud Azure library's source code directly.

### Spring Cloud Azure Core
This section includes changes in `spring-cloud-azure-core`, `spring-cloud-azure-service`, and `spring-cloud-azure-resourcemanager` modules.

#### Breaking Changes
- Deprecated `CloudType.AZURE_GERMANY` and remove `AzureEnvironmentProperties.AZURE_GERMANY` [#34663](https://github.com/Azure/azure-sdk-for-java/pull/34663).

## 5.0.0 (2023-01-17)
- This release is compatible with Spring Boot 3.0.0-3.0.1. (Note: 3.0.x (x>1) should be supported, but they aren't tested with this release.)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class AadProfileProperties {
*/
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.
/**
* 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`.
* Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.
*/
private AzureProfileOptionsProvider.CloudType cloudType;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class AzureProfileConfigurationProperties extends AzureProfileOptionsAdap
*/
private String subscriptionId;
/**
* 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`.
* Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.
*/
private AzureProfileOptionsProvider.CloudType cloudType;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
{
"name": "spring.cloud.azure.keyvault.secret.property-sources[0].profile.cloud-type",
"type": "com.azure.spring.cloud.core.provider.AzureProfileOptionsProvider$CloudType",
"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`.",
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
"sourceType": "com.azure.spring.cloud.autoconfigure.implementation.properties.core.profile.AzureProfileConfigurationProperties"
},
{
Expand Down Expand Up @@ -586,7 +586,7 @@
{
"name": "spring.datasource.azure.profile.cloud-type",
"type": "java.lang.String",
"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`.",
"description": "Name of the Azure cloud to connect to. Supported types are: AZURE, AZURE_CHINA, AZURE_US_GOVERNMENT, OTHER. The default value is `AZURE`.",
"sourceType": "com.azure.spring.cloud.service.implementation.passwordless.AzurePasswordlessProperties"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void configureAzureEventHubsPropertiesWithGlobalDefaults() {
@Test
void configureEventHubsDomainNameOverrideGlobalDefault() {
AzureGlobalProperties azureProperties = new AzureGlobalProperties();
azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);

this.contextRunner
.withBean(AzureGlobalProperties.class, () -> azureProperties)
Expand All @@ -140,8 +140,8 @@ void configureEventHubsDomainNameOverrideGlobalDefault() {
.run(context -> {
assertThat(context).hasSingleBean(AzureEventHubsProperties.class);
final AzureEventHubsProperties properties = context.getBean(AzureEventHubsProperties.class);
assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName());
assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName());
assertThat(properties.getDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ void getDomainNameFromCloud() {
@Test
void domainNameOverrideCloud() {
AzureEventHubsProperties eventHubsProperties = new AzureEventHubsProperties();
eventHubsProperties.setDomainName(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName());
eventHubsProperties.setDomainName(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName());
eventHubsProperties.getProfile().setCloudType(AZURE_CHINA);
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(),
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(),
eventHubsProperties.getDomainName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ void configureAzureServiceBusPropertiesWithGlobalDefaults() {
@Test
void configureServiceBusDomainNameOverrideGlobalDefault() {
AzureGlobalProperties azureProperties = new AzureGlobalProperties();
azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
azureProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);

this.contextRunner
.withBean("azureProperties", AzureGlobalProperties.class, () -> azureProperties)
Expand All @@ -110,8 +110,8 @@ void configureServiceBusDomainNameOverrideGlobalDefault() {
.run(context -> {
assertThat(context).hasSingleBean(AzureServiceBusProperties.class);
final AzureServiceBusProperties properties = context.getBean(AzureServiceBusProperties.class);
assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName());
assertThat(properties.getProfile().getCloudType()).isEqualTo(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertThat(properties.getProfile().getEnvironment().getServiceBusDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName());
assertThat(properties.getDomainName()).isEqualTo(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName());
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ void getDomainNameFromCloud() {
@Test
void domainNameOverrideCloud() {
AzureServiceBusProperties serviceBusProperties = new AzureServiceBusProperties();
serviceBusProperties.setDomainName(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName());
serviceBusProperties.setDomainName(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName());
serviceBusProperties.getProfile().setCloudType(AZURE_CHINA);
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(),
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(),
serviceBusProperties.getDomainName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ public class AzureEnvironmentProperties implements AzureProfileOptionsProvider.A
setServiceBusDomainName("servicebus.chinacloudapi.cn");
}};

/**
* Provides the environment instance for Azure Germany.
*/
public static final AzureEnvironmentProperties AZURE_GERMANY = new AzureEnvironmentProperties(AzureEnvironment.AZURE_GERMANY) {{
Comment thread
saragluna marked this conversation as resolved.
setServiceBusDomainName("servicebus.cloudapi.de");
}};

/**
* Provides the environment instance for Azure US Government.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ private AzureProfileOptionsProvider.AzureEnvironmentOptions decideAzureEnvironme
return AzureEnvironmentProperties.AZURE_CHINA;
case AZURE_US_GOVERNMENT:
return AzureEnvironmentProperties.AZURE_US_GOVERNMENT;
case AZURE_GERMANY:
return AzureEnvironmentProperties.AZURE_GERMANY;
Comment thread
saragluna marked this conversation as resolved.
case AZURE:
return AzureEnvironmentProperties.AZURE;
default:
Expand All @@ -61,8 +59,6 @@ public static AzureEnvironment decideAzureManagementEnvironment(AzureProfileOpti
return AzureEnvironment.AZURE_CHINA;
case AZURE_US_GOVERNMENT:
return AzureEnvironment.AZURE_US_GOVERNMENT;
case AZURE_GERMANY:
return AzureEnvironment.AZURE_GERMANY;
case AZURE:
return AzureEnvironment.AZURE;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ enum CloudType {

/**
* Azure Germany
* @deprecated AZURE_GERMANY is deprecated. Please use other CloudTypes.
*/
@Deprecated
AZURE_GERMANY,

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,16 @@ void domainNameDefaultsToNull() {

@Test
void domainNameConfigureAsCloud() {
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), consumerProperties.getDomainName());
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), consumerProperties.getDomainName());
}

@Test
void customDomainNameShouldSet() {
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
consumerProperties.setDomainName("new.servicebus.windows.net");
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType());
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType());
assertEquals("new.servicebus.windows.net", consumerProperties.getDomainName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,16 @@ void domainNameDefaultsToNull() {

@Test
void domainNameConfigureAsCloud() {
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), producerProperties.getDomainName());
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), producerProperties.getDomainName());
}

@Test
void customDomainNameShouldSet() {
producerProperties.setDomainName("new.servicebus.windows.net");
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType());
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType());
assertEquals("new.servicebus.windows.net", producerProperties.getDomainName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@ void domainNameDefaultsToNull() {

@Test
void domainNameConfigureAsCloud() {
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), consumerProperties.getDomainName());
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), consumerProperties.getDomainName());
}

@Test
void customDomainNameShouldSet() {
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
consumerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
consumerProperties.setDomainName("new.servicebus.windows.net");
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, consumerProperties.getProfile().getCloudType());
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, consumerProperties.getProfile().getCloudType());
assertEquals("new.servicebus.windows.net", consumerProperties.getDomainName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,16 @@ void domainNameDefaultsToNull() {

@Test
void domainNameConfigureAsCloud() {
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), producerProperties.getDomainName());
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), producerProperties.getDomainName());
}

@Test
void customDomainNameShouldSet() {
producerProperties.setDomainName("new.servicebus.windows.net");
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, producerProperties.getProfile().getCloudType());
producerProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, producerProperties.getProfile().getCloudType());
assertEquals("new.servicebus.windows.net", producerProperties.getDomainName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ void domainNameConfigureByDefault() {
@Test
void domainNameConfiguredAsCloud() {
NamespaceProperties namespaceProperties = new NamespaceProperties();
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);

assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), namespaceProperties.getDomainName());
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), namespaceProperties.getDomainName());
}

@Test
void domainNameOverrideCloud() {
NamespaceProperties namespaceProperties = new NamespaceProperties();
namespaceProperties.setDomainName("servicebus.chinacloudapi.cn");
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);

assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName(), namespaceProperties.getDomainName());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ void domainNameConfigureByDefault() {
@Test
void domainNameConfiguredAsCloud() {
NamespaceProperties namespaceProperties = new NamespaceProperties();
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);

assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_GERMANY.getServiceBusDomainName(), namespaceProperties.getDomainName());
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_US_GOVERNMENT.getServiceBusDomainName(), namespaceProperties.getDomainName());
}

@Test
void domainNameOverrideCloud() {
NamespaceProperties namespaceProperties = new NamespaceProperties();
namespaceProperties.setDomainName("servicebus.chinacloudapi.cn");
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY);
namespaceProperties.getProfile().setCloudType(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT);

assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_GERMANY, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureProfileOptionsProvider.CloudType.AZURE_US_GOVERNMENT, namespaceProperties.getProfile().getCloudType());
assertEquals(AzureEnvironmentProperties.AZURE_CHINA.getServiceBusDomainName(), namespaceProperties.getDomainName());
}
}