This commit is contained in:
Xiaolu Dai 2021-11-21 13:10:51 +08:00
Родитель d63fb77fd6
Коммит 32c8b428a1
9 изменённых файлов: 46 добавлений и 96 удалений

Просмотреть файл

@ -4,13 +4,11 @@
The `DefaultAzureCredential` is appropriate for most scenarios where the application is intended to ultimately be run in the Azure Cloud. This is because the DefaultAzureCredential combines credentials commonly used to authenticate when deployed, with credentials used to authenticate in a development environment.
====
Note: DefaultAzureCredential is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
====
NOTE: DefaultAzureCredential is intended to simplify getting started with the SDK by handling common scenarios with reasonable default behaviors. Developers who want more control or whose scenario isn't served by the default settings should use other credential types.
The `DefaultAzureCredential`` will attempt to authenticate via the following mechanisms in order.
image::https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/identity/azure-identity/images/defaultazurecredential.png[]
image::default-azure-credential.png[DefaultAzureCredential]
- Environment - The `DefaultAzureCredential` will read account information specified via environment variables and use it to authenticate.
- Managed Identity - If the application is deployed to an Azure host with Managed Identity enabled, the `DefaultAzureCredential` will authenticate with that account.
@ -18,9 +16,7 @@ image::https://raw.githubusercontent.com/Azure/azure-sdk-for-java/main/sdk/ident
- Visual Studio Code - If the developer has authenticated via the Visual Studio Code Azure Account plugin, the `DefaultAzureCredential` will authenticate with that account.
- Azure CLI - If the developer has authenticated an account via the Azure CLI az login command, the `DefaultAzureCredential` will authenticate with that account.
====
*Warning*: There could be some `ERROR` logs be printed out while the `DefaultAzureCredential` running the chain and trying to find the first available credential. It doesn't mean the `DefaultAzureCredential` is broken or unavailable. Meanwhile, we'll keep improving this logging experience.
====
IMPORTANT: There could be some `ERROR` logs be printed out while the `DefaultAzureCredential` running the chain and trying to find the first available credential. It doesn't mean the `DefaultAzureCredential` is broken or unavailable. Meanwhile, we'll keep improving this logging experience.
=== Managed Identity

Просмотреть файл

@ -24,7 +24,8 @@ There are some properties that could be shared among different Azure services, f
|spring.cloud.azure.retry |To configure the retry options apply to all Azure SDK clients by default.
|===
Please note that properties configured under each Azure service will override the global configurations.
NOTE: Properties configured under each Azure service will override the global configurations.
The configuration properties' prefixes have been unified to `spring.cloud.azure` namespace since Spring Cloud Azure 4.0, it will make configuration properties more consistent and more intuitive. Here's a quick review of the prefixes of supported Azure services.

Двоичные данные
docs/src/main/asciidoc/images/default-azure-credential.png Normal file

Двоичный файл не отображается.

После

Ширина:  |  Высота:  |  Размер: 47 KiB

Просмотреть файл

@ -177,11 +177,7 @@ target Azure resources.
A chained credential, the https://docs.microsoft.com/en-us/java/api/overview/azure/identity-readme?view=azure-java-stable#defaultazurecredential[DefaultAzureCredential] bean is auto-configured by default and will be used by all components if no more authentication information is specified.
____
Warning: There could be some `ERROR` logs be printed out while the `DefaultAzureCredential` running the chain and trying to find the first available credential. It doesn't mean the `DefaultAzureCredential` is broken or unavailable. Meanwhile, we'll keep improving this logging experience.
____
IMPORTANT: There could be some `ERROR` logs be printed out while the `DefaultAzureCredential` running the chain and trying to find the first available credential. It doesn't mean the `DefaultAzureCredential` is broken or unavailable. Meanwhile, we'll keep improving this logging experience.
=== Configuration properties
@ -231,11 +227,8 @@ Check link:appendix.html[here] for a full list of configurations.
===== spring-cloud-azure-starter-integration-eventhubs
____
(legacy: azure-spring-cloud-starter-eventhubs)
____
IMPORTANT: Legacy starter is `azure-spring-cloud-starter-eventhubs`.
prefix changed from
`spring.cloud.azure.eventhub.`
@ -282,11 +275,8 @@ spring:
===== spring-cloud-azure-stream-binder-eventhubs
____
IMPORTANT: Legacy starter is `azure-spring-cloud-stream-binder-eventhubs`.
(legacy: azure-spring-cloud-stream-binder-eventhubs)
____
* As per prefix of `spring.cloud.azure.eventhub,`, prefix is re-defined as
`spring.cloud.azure.eventhubs,`
@ -359,11 +349,7 @@ spring:
===== spring-cloud-azure-starter-integration-servicebus
____
(legacy: azure-spring-cloud-starter-servicebus)
____
IMPORTANT: Legacy starter is `azure-spring-cloud-starter-servicebus`.
For all configuration options supported in spring-cloud-azure-starter-integration-servicebus and spring-integration-azure-servicebus libraries,
the prefix remains to be as `spring.cloud.azure.servicebus.`.
@ -381,11 +367,7 @@ the prefix remains to be as `spring.cloud.azure.servicebus.`.
===== spring-cloud-azure-stream-binder-servicebus
____
(legacy: azure-spring-cloud-stream-binder-servicebus-queue,azure-spring-cloud-stream-binder-servicebus-topic)
____
IMPORTANT: Legacy binder libaries are `azure-spring-cloud-stream-binder-servicebus-queue` and `azure-spring-cloud-stream-binder-servicebus-topic`, and now they are merged into one `spring-cloud-azure-stream-binder-servicebus`.
We have merged these two libraries into one, which supports both topic and queue. And the binder type is combined as `servicebus`.
@ -404,7 +386,7 @@ We have merged these two libraries into one, which supports both topic and queue
|`spring.cloud.stream.servicebus.topic.bindings.*` |`spring.cloud.stream.servicebus.bindings.*`
|===
please note: the binder type is renamed from: servicebus-queue/servicebus-topic to `servicebus`.
IMPORTANT: The binder type is renamed from: servicebus-queue/servicebus-topic to `servicebus`.
* If you use the Spring Cloud Stream binder for Azure Service Bus queue/topicnow your properties configuration should be changed to:
[source,yaml]
@ -497,7 +479,9 @@ spring:
===== From `azure-spring-boot-starter-cosmos` to `spring-cloud-azure-starter-data-cosmos`
. All configuration property names changed the prefix from `azure.cosmos` to `spring.cloud.azure.cosmos`.|===
. All configuration property names changed the prefix from `azure.cosmos` to `spring.cloud.azure.cosmos`.
|===
|Legacy properties |Morden properties
|azure.cosmos.uri |spring.cloud.azure.cosmos.endpoint
@ -506,9 +490,13 @@ spring:
|azure.cosmos.populateQueryMetrics |spring.cloud.azure.cosmos.populateQueryMetrics
|===
| ===== From *azure-spring-boot-starter-storage* to *spring-cloud-azure-starter-storage-blob*
. All configuration property names changed the prefix from `azure.storage` to `spring.cloud.azure.storage.blob`.|===
===== From *azure-spring-boot-starter-storage* to *spring-cloud-azure-starter-storage-blob*
. All configuration property names changed the prefix from `azure.storage` to `spring.cloud.azure.storage.blob`.
|===
|Legacy properties |Morden properties
|azure.storage.account-name |spring.cloud.azure.storage.blob.account-name
@ -528,6 +516,7 @@ All configuration property names changed the prefix from `azure.storage` to `spr
|azure.storage.file-endpoint |spring.cloud.azure.storage.fileshare.endpoint
|===
===== From *azure-spring-cloud-starter-storage-queue* to *spring-cloud-azure-starter-integration-storage-queue*
All configuration property names changed the prefix from `spring.cloud.azure.storage` to `spring.cloud.azure.storage.queue`.
@ -543,11 +532,9 @@ All configuration property names changed the prefix from `spring.cloud.azure.sto
=== API breaking changes
==== spring-cloud-azure-stream-binder-eventhubs
____
(legacy: azure-spring-cloud-stream-binder-eventhubs)
____
IMPORTANT: Legacy binder is `azure-spring-cloud-stream-binder-eventhubs`.
|===
|Legacy class |Modern class
@ -558,11 +545,8 @@ ____
|===
==== spring-cloud-azure-starter-integration-eventhubs
____
(legacy: azure-spring-cloud-starter-eventhubs)
____
IMPORTANT: legacy: azure-spring-cloud-starter-eventhubs)
* Annotation of `@AzureMessageListeners`, `@AzureMessageListener` and `@EnableAzureMessaging` are dropped.
* Drop `EventHubOperation`, and move its `subscribe` API to class of `EventHubsProcessorContainer`.
@ -672,11 +656,8 @@ Modern code:
|===
==== spring-cloud-azure-stream-binder-servicebus
____
(legacy: azure-spring-cloud-stream-binder-servicebus)
____
IMPORTANT: Legacy binder is `azure-spring-cloud-stream-binder-servicebus`.
|===
|Legacy class |Modern class
@ -688,11 +669,7 @@ ____
==== spring-cloud-azure-starter-integration-servicebus
____
(legacy: azure-spring-cloud-starter-servicebus)
____
IMPORTANT: Legacy library is `azure-spring-cloud-starter-servicebus`.
- Annotation of `@AzureMessageListeners`, `@AzureMessageListener` and `@EnableAzureMessaging` are dropped.
- Combine the original `ServiceBusQueueTemplate#sendAsync` and `ServiceBusTopicTemplate#sendAsync` as `ServiceBusTemplate#sendAsync`

Просмотреть файл

@ -24,10 +24,7 @@ Below properties could be used to enable or disable health indicators for each A
|Storage|management.health.azure-storage.enabled
|===
____
*Please note*: Calling the health endpoint of Azure servcies could cause extra charge. For example, calling `http://{hostname}:{port}/actuator/health/cosmos` to get the Cosmos DB health info, it will calculate https://docs.microsoft.com/azure/cosmos-db/request-units[RUs].
____
NOTE: Calling the health endpoint of Azure servcies could cause extra charge. For example, calling `http://{hostname}:{port}/actuator/health/cosmos` to get the Cosmos DB health info, it will calculate https://docs.microsoft.com/azure/cosmos-db/request-units[RUs].
=== Enable Sleuth
@ -40,9 +37,7 @@ Add the Spring Cloud Azure Trace Sleuth dependency when you want to trace Azure
<artifactId>spring-cloud-azure-trace-sleuth</artifactId>
</dependency>
----
____
*Please note*: Only HTTP-based Azure SDK clients are supported now.
____
NOTE: Only HTTP-based Azure SDK clients are supported now.

Просмотреть файл

@ -149,9 +149,7 @@ mode is set true.
Default: `RECORD`
----
Notes: when consume batch mode is false(default value), `BATCH` checkpoint mode is not invalid.
----
NOTE: when consume batch mode is false(default value), `BATCH` checkpoint mode is not invalid.
*_checkpoint-count_*
@ -485,7 +483,8 @@ For full configurations, check appendix
This example demonstrates how to manually set the partition key for the message in the application.
*Way 1:*
*Approach 1:* Set partition key expression.
This example requires that `spring.cloud.stream.default.producer.partitionKeyExpression` be set `&quot;&#39;partitionKey-&#39; + headers[&lt;message-header-key&gt;]&quot;`.
[source,yaml]
@ -513,14 +512,12 @@ public ResponseEntity<String> sendMessage(@RequestParam String message) {
}
----
____
*NOTE:* When using `application.yml` to configure the partition key, its priority will be the lowest.
NOTE: When using `application.yml` to configure the partition key, its priority will be the lowest.
It will take effect only when the `ServiceBusMessageHeaders.SESSION_ID`, `ServiceBusMessageHeaders.PARTITION_KEY`, `AzureHeaders.PARTITION_KEY` are not configured.
*Way 2:*
Manually add the partition Key in the message header by code.
____
*Approach 2:* Manually add the partition Key in the message header by code.
_Recommended:_ Use `ServiceBusMessageHeaders.PARTITION_KEY` as the key of the header.
@ -550,13 +547,10 @@ public ResponseEntity<String> sendMessage(@RequestParam String message) {
}
----
____
*NOTE:* When both `ServiceBusMessageHeaders.PARTITION_KEY` and `AzureHeaders.PARTITION_KEY` are set in the message headers,
NOTE: When both `ServiceBusMessageHeaders.PARTITION_KEY` and `AzureHeaders.PARTITION_KEY` are set in the message headers,
`ServiceBusMessageHeaders.PARTITION_KEY` is preferred.
*Example: Set the session id for the message*
____
*Example: Set the session id for the message*
This example demonstrates how to manually set the session id of a message in the application.
@ -572,12 +566,10 @@ public ResponseEntity<String> sendMessage(@RequestParam String message) {
}
----
____
*NOTE:* When the `ServiceBusMessageHeaders.SESSION_ID` is set in the message headers, and a different `ServiceBusMessageHeaders.PARTITION_KEY` (or `AzureHeaders.PARTITION_KEY`) header is also set,
NOTE: When the `ServiceBusMessageHeaders.SESSION_ID` is set in the message headers, and a different `ServiceBusMessageHeaders.PARTITION_KEY` (or `AzureHeaders.PARTITION_KEY`) header is also set,
the value of the session id will eventually be used to overwrite the value of the partition key.
Please use this `sample` as a reference to learn more about how to use this binder in your project.
- https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/servicebus/azure-spring-cloud-stream-binder-servicebus-queue[Service Bus Queue]
____

Просмотреть файл

@ -448,10 +448,8 @@ Please refer to this https://github.com/Azure-Samples/azure-spring-boot-samples/
This example demonstrates how to manually set the partition key for the message in the application.
*Way 1:*
Manually add the partition Key in the message header by code.
*Approach 1:* Manually add the partition Key in the message header by code.
____
_Recommended:_ Use `ServiceBusMessageHeaders.PARTITION_KEY` as the key of the header.
@ -485,13 +483,11 @@ public class SampleController {
}
----
____
*NOTE:* When both `ServiceBusMessageHeaders.PARTITION_KEY` and `AzureHeaders.PARTITION_KEY` are set in the message headers,
NOTE: When both `ServiceBusMessageHeaders.PARTITION_KEY` and `AzureHeaders.PARTITION_KEY` are set in the message headers,
`ServiceBusMessageHeaders.PARTITION_KEY` is preferred.
*Example: Set the session id for the message*
____
This example demonstrates how to manually set the session id of a message in the application.
@ -509,9 +505,7 @@ public class SampleController {
}
----
____
*NOTE:* When the `ServiceBusMessageHeaders.SESSION_ID` is set in the message headers, and a different `ServiceBusMessageHeaders.PARTITION_KEY` (or `AzureHeaders.PARTITION_KEY`) header is also set,
NOTE: When the `ServiceBusMessageHeaders.SESSION_ID` is set in the message headers, and a different `ServiceBusMessageHeaders.PARTITION_KEY` (or `AzureHeaders.PARTITION_KEY`) header is also set,
the value of the session id will eventually be used to overwrite the value of the partition key.
=== Spring Integration with Azure Storage Queue

Просмотреть файл

@ -195,7 +195,9 @@ This scenario uses the https://docs.microsoft.com/azure/active-directory/develop
image:https://user-images.githubusercontent.com/13167207/142617664-f1704adb-db64-49e0-b1b6-078c62b6945b.png[Standalone Web Application]
* Step 1: Make sure `redirect URI` has been set to `{application-base-uri}/login/oauth2/code/`, for
example `http://localhost:8080/login/oauth2/code/`. Note the tailing `/` cannot be omitted.
example `http://localhost:8080/login/oauth2/code/`.
CAUTION: The tailing `/` cannot be omitted.
image:https://user-images.githubusercontent.com/13167207/142617751-154c156c-9035-4641-9b79-b26380ddad72.png[web-application-set-redirect-uri-1.png]
image:https://user-images.githubusercontent.com/13167207/142617785-b4ca1afc-79f6-48ae-b7a3-99fba5856689.png[web-application-set-redirect-uri-2.png]

Просмотреть файл

@ -2,16 +2,12 @@
This section covers the changes made from version 3.10 to version 4.0.0-beta.1. With this major release, we aim to bring better security, leaner dependencies, support for production readiness, and more.
To learn how to migration to 4.0, please check link:appendix.html[the Appendix page].
IMPORTANT: To learn how to migration to 4.0, please check link:appendix.html[the Appendix page].
=== Unified Development Experience
We constantly challenge ourselves on how we can make things more consistent and easier to understand, so our customers are not confronted with haphazard development choices. This is a long and self-evolving journey as consistency is relative and there will be things that are outside of our control. We now humbly take another step in this direction to improve to our developer experience by unifying project name, artifact ID and properties.
[TIP]
====
Example or screenshot
====
=== Simplified dependency management
@ -42,10 +38,7 @@ At the heart of every real-world application, is identity and secret management.
Spring developers have long enjoyed the convenience of defining client options in application configuration files. We certainly do not want to take that privilege away and burden Spring developers with setting options via client objects. To that end, weve significantly improved autoconfiguration coverage of Azure SDK clients for both synchronous and asynchronous scenarios.
[TIP]
====
Sample code
====
=== More Production Ready
Lastly all of the above would be in vain if we do not have enough feature coverage to support our customers in production. Many things come to my mind to make an application production-ready, but observability often arrives at the top. Weve added health indicators for App Configuration, Event Hubs, Cosmos, Key Vault, Storage Blob, Storage Queue, Storage File, as well as Spring Cloud Sleuth support for all HTTP-based Azure SDKs. As an example, you now can prob if storage blob is up or down via Spring Boot actuator endpoint, as well as track dependencies and latencies going from your application to Cosmos DB.