Coder Social home page Coder Social logo

azure-samples / azure-spring-boot-samples Goto Github PK

View Code? Open in Web Editor NEW
162.0 18.0 230.0 17.16 MB

Spring Cloud Azure Samples

License: MIT License

Java 35.36% HTML 11.31% JavaScript 38.61% CSS 1.56% Shell 2.32% Dockerfile 0.07% Less 0.40% HCL 9.02% PowerShell 1.36%
spring-boot spring-cloud spring azure azure-spring-cloud azure-storage azure-eventhub azure-service-bus azure-cosmosdb spring-cloud-azure

azure-spring-boot-samples's Introduction

CodeQL CI Markdown Links Check

Spring Cloud Azure Samples

  • The repository hold samples about using Spring Cloud Azure libraries.
  • The main branch is using the latest stable version of Spring Cloud Azure. If you want to find sample about specific version of Spring Cloud Azure, please switch to corresponding tag in this repository.

All Samples in This Repo

Microsoft Entra ID

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
aad-b2c-resource-server
aad-b2c-web-application
aad-resource-server-by-filter-stateless
aad-resource-server-by-filter
web-client-access-resource-server
aad-webapp-resource-server

Azure App Configuration

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
spring-cloud-azure-appconfiguration-config-convert-sample-complete
spring-cloud-azure-appconfiguration-config-sample
spring-cloud-azure-appconfiguration-config-convert-sample-initial
spring-cloud-azure-feature-management-sample
spring-cloud-azure-feature-management-web-sample
spring-cloud-azure-starter-appconfiguration-config-sample
appconfiguration-client

Azure Cache

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
azure-spring-cloud-sample-cache

Azure Cosmos DB

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
azure-spring-data-cosmos-sample
spring-cloud-azure-data-cosmos-sample
spring-cloud-azure-cosmos-sample

Azure Event Hubs

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
spring-cloud-azure-sample-eventhubs-kafka
eventhubs-integration
eventhubs-binder
eventhubs-multibinders
eventhubs-client

Azure Key Vault

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
keyvault-certificates-client-side
keyvault-certificates-server-side
run-with-command-line-server-side
run-with-command-line-client-side
property-source
secret-client

Azure Database for MySQL

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
spring-cloud-azure-mysql-sample

Azure Database for PostgreSQL

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
spring-cloud-azure-postgresql-sample

Azure Service Bus

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
servicebus-queue
servicebus-topic
servicebus-jms-queue
servicebus-jms-topic
single-namespace
multiple-namespaces
servicebus-queue-binder
servicebus-queue-multibinders
servicebus-topic-binder
servicebus-queue-binder-arm

Azure Storage

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
storage-blob-sample
storage-file-sample
storage-queue-client
storage-queue-integration
storage-queue-operation

Spring PetClinic

Sample Project Support Spring Cloud Azure 4.x Support Spring Cloud Azure 5.x
spring-petclinic-microservices

Getting Help

Introduction to Maven profiles

This project uses one pom file to manage the samples for Spring Cloud Azure 4.x and Spring Cloud Azure 5.x, the profile spring-cloud-azure-4.x is activated by default.

The profile names ending with -4.x are used to run the samples with Spring Cloud Azure 4.x and Spring Boot 2; the profile names ending with -5.x are used to run the samples with Spring Cloud Azure 5.x and Spring Boot 3. The profile names ending with 4.x and 5.x cannot be mixed at the same time.

Note:

  • Profiles native-5.x and nativeTest-5.x are variants of the two profiles native and nativeTest provided by spring-boot-starter-parent of Spring Boot 3, and they have the same function. If you want to use this profile, please use it with the profile spring-cloud-azure-5.x, such as mvn -P spring-cloud-azure-5.x,native-5.x native:compile.

Samples for Spring Boot 3

Note: This section is used to convert the samples to run in Spring Boot 3, the branch feature/spring-boot-3 is no longer maintained.

Convert samples to use Spring Boot 3

To get samples for Spring Boot 3, please refer to the content in each sample's README.md like this:

Current sample is using Spring Cloud Azure 4.x (which is compatible with Spring Boot 2.x). If you want sample about Spring Cloud Azure 5.x (which is compatible with Spring Boot 3.x), please refer to CONVERT_SAMPLE_TO_USE_SPRING_BOOT_3.md.

Mostly samples can work with both Spring Cloud Azure 4.x and Spring Cloud Azure 5.x, you can directly activate the profile of Spring Cloud Azure 5.x to run.

If you're adding a new example, here's a template that converts the example to support Spring Boot 3: ./CONVERT_SAMPLE_TO_USE_SPRING_BOOT_3_TEMPLATE.md.

Run samples with Maven command

Use below command to enable the profile for Spring Cloud Azure 5.x.

mvn clean spring-boot:run -P spring-cloud-azure-5.x

Run samples with IDE

Activate the profile Spring Cloud Azure 5.x by default, then you can run in your IDE tool.

Remove the below activation for spring-cloud-azure-4.x, and add it to profile spring-cloud-azure-5.x:

<activation>
  <activeByDefault>true</activeByDefault>
</activation>

azure-spring-boot-samples's People

Contributors

backwind1233 avatar dependabot[bot] avatar diegoflores avatar fangjian0423 avatar hui1110 avatar ivywei0125 avatar jialigit avatar michaelqi793 avatar microsoft-github-operations[bot] avatar microsoftopensource avatar moarychan avatar mrm9084 avatar netyyyy avatar nickdala avatar rujche avatar saragluna avatar stliu avatar theovankraay avatar trande4884 avatar yiliuto avatar zhichengliu12581 avatar zhuxiaobing-cn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azure-spring-boot-samples's Issues

Failed to create consumer binding; retrying in 30 seconds

I followed the Spring Cloud Azure Stream Binder for Service Bus topic Sample shared library for Java.
While doing so and when the app is launched it throws : Failed to create consumer binding; retrying in 30 seconds

(Azure/azure-sdk-for-java#24040)

org.springframework.cloud.stream.binder.BinderException: Exception thrown while starting consumer: at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:462) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:91) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at org.springframework.cloud.stream.binder.AbstractBinder.bindConsumer(AbstractBinder.java:143) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at org.springframework.cloud.stream.binding.BindingService.lambda$rescheduleConsumerBinding$1(BindingService.java:202) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) ~[spring-context-5.3.9.jar:5.3.9] at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) ~[na:na] at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na] at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130) ~[na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630) ~[na:na] at java.base/java.lang.Thread.run(Thread.java:832) ~[na:na] Caused by: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'exam-topic.tsubscription-one.errors.recoverer' defined in null: Cannot register bean definition [Root bean: class [org.springframework.integration.handler.advice.ErrorMessageSendingRecoverer]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] for bean 'exam-topic.tsubscription-one.errors.recoverer': There is already [Root bean: class [org.springframework.integration.handler.advice.ErrorMessageSendingRecoverer]; scope=; abstract=false; lazyInit=null; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null] bound. at org.springframework.beans.factory.support.DefaultListableBeanFactory.registerBeanDefinition(DefaultListableBeanFactory.java:995) ~[spring-beans-5.3.9.jar:5.3.9] at org.springframework.context.support.GenericApplicationContext.registerBeanDefinition(GenericApplicationContext.java:330) ~[spring-context-5.3.9.jar:5.3.9] at org.springframework.context.support.GenericApplicationContext.registerBean(GenericApplicationContext.java:478) ~[spring-context-5.3.9.jar:5.3.9] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.registerErrorInfrastructure(AbstractMessageChannelBinder.java:687) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.registerErrorInfrastructure(AbstractMessageChannelBinder.java:639) ~[spring-cloud-stream-3.1.3.jar:3.1.3] at com.azure.spring.servicebus.stream.binder.ServiceBusTopicMessageChannelBinder.createConsumerEndpoint(ServiceBusTopicMessageChannelBinder.java:49) ~[azure-spring-cloud-stream-binder-servicebus-topic-2.8.0.jar:na] at com.azure.spring.servicebus.stream.binder.ServiceBusTopicMessageChannelBinder.createConsumerEndpoint(ServiceBusTopicMessageChannelBinder.java:23) ~[azure-spring-cloud-stream-binder-servicebus-topic-2.8.0.jar:na] at org.springframework.cloud.stream.binder.AbstractMessageChannelBinder.doBindConsumer(AbstractMessageChannelBinder.java:408) ~[spring-cloud-stream-3.1.3.jar:3.1.3]

Here is the application.yaml

spring:
cloud:
azure:
servicebus:
connection-string: [sb://vyom-broker.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=w1n+xtKl9Z9r0l0dyXk9tRq4K9GEi2pNGsS2L4yhUj2=]
stream:
bindings:
consume-in-0:
destination: exam-topic
group: tsubscription-one
supply-out-0:
destination: exam-topic
servicebus:
topic:
bindings:
consume-in-0:
consumer:
checkpoint-mode: MANUAL
function:
definition: consume;supply;
poller:
fixed-delay: 1000
initial-delay: 0
autoconfigure:
exclude: com.azure.spring.cloud.autoconfigure.servicebus.AzureServiceBusQueueAutoConfiguration
profiles:
active: manual

OBO example doesn't work properly

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Complete the example found here, I did the bare minimum and just did the graph access. Don't worry about the other resource server examples in the properties file.
  2. With a token that is valid for your resource server, run these two example calls, you'll notice that the call-graph endpoint works fine, but the call-graph-with-repository fails.

Any log messages given by the failure

no logs are outputted, just a 401 response.

Expected/desired behavior

I'd expect the call-graph-with-repository endpoint to act the same as the call-graph endpoint.

OS and Version?

Ubuntu 20.04

Versions

azure-spring-boot-starter-active-directory version 3.7.0

Mention any other details that might be useful

It has something to do with this line here, as graph always ends up null. I've debugged through a bit and I think it's because it's using the wrong repository to get the authorized clients.


Thanks! We'll be in touch soon.

File paths too long when cloning repo - please rename paths

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Clone the repo on Windows from PowerShell. I cloned in C:\code

Any log messages given by the failure

Cloning into 'azure-spring-boot-samples'...
remote: Enumerating objects: 13066, done.
remote: Counting objects: 100% (2913/2913), done.
remote: Compressing objects: 100% (745/745), done.
remote: Total 13066 (delta 2468), reused 2250 (delta 2110), pack-reused 10153
Receiving objects: 100% (13066/13066), 12.11 MiB | 4.94 MiB/s, done.
Resolving deltas: 100% (5033/5033), done.
error: unable to create file aad/spring-security/reactive/webflux/oauth2/spring-cloud-gateway/resource-server-2/src/main/java/com/azure/spring/sample/activedirectory/reactive/webflux/oauth2/gateway/resourceserver2/configuration/ApplicationConfiguration.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/client-access-multiple-resource-server/resource-server-1/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample03/resource/server1/configuration/ApplicationConfiguration.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/client-access-multiple-resource-server/resource-server-1/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample03/resource/server1/configuration/WebSecurityConfiguration.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/client-access-multiple-resource-server/resource-server-2/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample03/resource/server2/configuration/ApplicationConfiguration.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/client-access-multiple-resource-server/resource-server-2/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample03/resource/server2/configuration/WebSecurityConfiguration.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/login-authenticate-using-private-key-jwt/src/main/java/com/azure/spring/sample/reactive/servlet/oauth2/login/jwt/azure/activedirectory/AzureActiveDirectoryCertificateSignedJwtAssertionFactory.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/login-authenticate-using-private-key-jwt/src/main/java/com/azure/spring/sample/reactive/servlet/oauth2/login/jwt/azure/activedirectory/AzureActiveDirectoryJwtClientAuthenticationParametersConverter.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/login-authenticate-using-private-key-jwt/src/test/java/com/azure/spring/sample/reactive/servlet/oauth2/login/jwt/azure/activedirectory/AzureActiveDirectoryCertificateSignedAssertionFactoryTest.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/resource-server-check-permissions-by-claims-in-access-token/client/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample02/client/configuration/ApplicationConfiguration.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/resource-server-check-permissions-by-claims-in-access-token/client/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample02/client/configuration/WebSecurityConfiguration.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/resource-server-check-permissions-by-claims-in-access-token/client/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample02/client/controller/CheckPermissionByScopeController.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/resource-server-check-permissions-by-claims-in-access-token/client/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample02/client/controller/ResourceServerController.java: Filename too long
error: unable to create file aad/spring-security/servlet/oauth2/resource-server-check-permissions-by-claims-in-access-token/resource-server/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample02/resource/server/ResourceServerApplication.java: Filename too long
fatal: cannot create directory at 'aad/spring-security/servlet/oauth2/resource-server-check-permissions-by-claims-in-access-token/resource-server/src/main/java/com/azure/spring/sample/active/directory/oauth2/servlet/sample02/resource/server/configuration': Filename too long
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

Expected/desired behavior

no issues should appear when cloning the repo

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Azure B2C: Support for Webflux

- [ ] bug report -> please search issues before submitting
- [X] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Would like the ability to use Webflux with the azure-spring-boot-starter-active-directory-b2c package. If this is already supported, how exactly does one use it with Webflux?

PoolAcquirePendingLimitException, Pending acquire queue has reached its maximum size of 1000

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ X] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. clone this
    https://github.com/Azure-Samples/azure-spring-boot-samples/tree/tag_azure-spring-boot_3.6.0/eventhubs/azure-spring-cloud-sample-eventhubs-binder

  2. posting thousands of messages to the event hub

  3. and run mvn spring-boot:run

Any log messages given by the failure

2021-08-18 18:04:52.407 INFO 5196 --- [tition-pump-1-2] c.a.s.s.e.b.EventHubBinderApplication : New message received: '{user_id=uid001, last_updated=578925754902300, subtitle=KR, content_id=ID35685, progress=on, category=cat1}', partition key: null, sequence number: 24326, offset: 4298837352, enqueued time: 2021-08-18T07:45:54.149Z
2021-08-18 18:04:52.407 ERROR 5196 --- [ parallel-1] c.a.s.s.e.b.EventHubBinderApplication : Exception found

reactor.netty.internal.shaded.reactor.pool.PoolAcquirePendingLimitException: Pending acquire queue has reached its maximum size of 1000
at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.drainLoop(SimpleDequePool.java:363) ~[reactor-netty-core-1.0.7.jar:1.0.7]
at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.pendingOffer(SimpleDequePool.java:549) ~[reactor-netty-core-1.0.7.jar:1.0.7]
at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool.doAcquire(SimpleDequePool.java:266) ~[reactor-netty-core-1.0.7.jar:1.0.7]
at reactor.netty.internal.shaded.reactor.pool.AbstractPool$Borrower.request(AbstractPool.java:399) [reactor-netty-core-1.0.7.jar:1.0.7]
at reactor.netty.resources.DefaultPooledConnectionProvider$DisposableAcquire.onSubscribe(DefaultPooledConnectionProvider.java:213) ~[reactor-netty-core-1.0.7.jar:1.0.7]
at reactor.netty.internal.shaded.reactor.pool.SimpleDequePool$QueueBorrowerMono.subscribe(SimpleDequePool.java:674) ~[reactor-netty-core-1.0.7.jar:1.0.7]
at reactor.netty.resources.PooledConnectionProvider.lambda$acquire$1(PooledConnectionProvider.java:137) ~[reactor-netty-core-1.0.7.jar:1.0.7]
at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:57) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.lambda$subscribe$0(HttpClientConnect.java:269) ~[reactor-netty-http-1.0.7.jar:1.0.7]
at reactor.core.publisher.MonoCreate.subscribe(MonoCreate.java:57) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.netty.http.client.HttpClientConnect$MonoHttpConnect.subscribe(HttpClientConnect.java:272) ~[reactor-netty-http-1.0.7.jar:1.0.7]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.FluxRetryWhen.subscribe(FluxRetryWhen.java:76) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.MonoRetryWhen.subscribeOrReturn(MonoRetryWhen.java:46) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:57) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.MonoDefer.subscribe(MonoDefer.java:52) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:52) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.MonoDelaySubscription.accept(MonoDelaySubscription.java:33) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.FluxDelaySubscription$DelaySubscriptionOtherSubscriber.onNext(FluxDelaySubscription.java:130) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.propagateDelay(MonoDelay.java:270) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.publisher.MonoDelay$MonoDelayRunnable.run(MonoDelay.java:285) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.4.6.jar:3.4.6]
at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.4.6.jar:3.4.6]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[na:1.8.0_272]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) ~[na:1.8.0_272]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) ~[na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_272]
at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_272]

Expected/desired behavior

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

Versions

as listed in the maven build file

Mention any other details that might be useful

same situation at the customer, i was trying to reproduce it with the example posted here, but same error


Thanks! We'll be in touch soon.

[Epic] Tasks related to version 4.1.0 sample

Context

This is an Epic to track all sample tasks with the GitHub task feature. Here is the task list:

  • #40
  • #43
  • Make sure all code snippets in doc(not sample) have imports.
  • Check and fix Out-of-date samples.
    • EventHubs-Kafka: Example is out of date (dependencies versions are old)
    • azure-spring-cloud-sample-servicebus-topic-binder: example is out of date
    • Storage queue: Queue name is not in the config, not clear where to change or if it will be created.
  • Make azure-spring-boot-sample-keyvault-secrets consistant with configure-spring-boot-starter-java-app-with-azure-key-vault
  • #26
  • #30
  • #35
  • A wiki page to list all samples and analyze samples
    - there are features sdk support but not covered in this repo.
  • Rename artifactId
  • #42

Not use tags like `azure-spring-boot_3.6.0` in links

Context

In current main branch, there are a lot of links like https://github.com/Azure/azure-sdk-for-java/blob/azure-spring-boot_3.6.0/sdk. which contains azure-spring-boot_3.6.0. That is not right, we should use latest tag instead, for example: spring-cloud-azure_4.2.0. You can search /azure-spring-boot_ in current repo to get all these links. Here is screenshot of search result:

image

Goal

Update these links.

Samples don't work as expected in WSL

Tracked in Azure/azure-sdk-for-java#26301

The following samples do not work properly in WSL, this link has the details of the problem.

sample name
eventhubs/spring-cloud-azure-stream-binder-eventhubs
servicebus/spring-cloud-azure-stream-binder-servicebus
servicebus/spring-cloud-azure-starter-servicebus-jms/servicebus-jms-queue
servicebus/spring-cloud-azure-starter-servicebus-jms/servicebus-jms-topic
servicebus/spring-cloud-azure-starter-integration-servicebus/multiple-namespaces

Authentication Error when trying to access Storage Queue using service principal

Describe the bug
Authentication Error when trying to access Storage Queue using service principal.

Exception or Stack Trace

com.azure.storage.queue.models.QueueStorageException: If you are using a StorageSharedKeyCredential, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate method call.
If you are using a SAS token, and the server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate generateSas method call.
Please remember to disable 'Azure-Storage-Log-String-To-Sign' before going to production as this string can potentially contain PII.
Status code 403, "?<?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:xxxxxxxxxx-xxx-xxxxxx-6085-xxxxxxxxxxxx
Time:2022-02-16T22:33:18.4506561Z</Message><AuthenticationErrorDetail>The MAC signature found in the HTTP request 'XXXXXXXXXXXXXXX' is not the same as any computed signature. Server used following string to sign: 'PUT

Wed, 16 Feb 2022 22:33:16 GMT

x-ms-client-request-id:xxxxxxxxx-53cf-xxxxxx-96c6-xxxxxxxx
x-ms-version:2020-10-02

To Reproduce
I'm trying to access storage queue using service principal through spring boot example mentioned below.
https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/storage/azure-spring-cloud-starter-storage-queue/storage-queue-operation
I'm using intellij and trying to add a message to the queue and end up with the error. However I'm able to add a message using storage account and access key combination.

Code Snippet
Add the code snippet that causes the issue.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [e.g. iOS]
  • IDE: [e.g. IntelliJ]
  • Library/Libraries: [e.g. com.azure:azure-core:1.16.0 (groupId:artifactId:version)]
  • Java version: [e.g. 8]
  • App Server/Environment: [e.g. Tomcat, WildFly, Azure Function, Apache Spark, Databricks, IDE plugin or anything special]
  • Frameworks: [e.g. Spring Boot, Micronaut, Quarkus, etc]

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Unify Sample's readme template

Each Sample in this repo should share one common structure or template ,eg: readme
Eg: Readme Structure

  • Goal
  • Key concepts
  • How to config
    • connectionString
    • service principal
      • Access control (IAM) :assign role
    • msi
  • configurable parameters
  • Running locally
  • deployment
    • Deploy to Azure Spring Cloud

[FEATURE REQ] The context of Azure CLI and the environment variables cannot be shared in Docker container

Context

The current samples are using Terraform to create and destroy Azure resources based on Azure CLI authentication, then output the environment variables to share the configuration of the Azure resources.
But when running in the docker containers, the application will fail because it can't get environment variables and Azure CLI information.

Goal

Make it successfully to run samples for the docker users. It could be a guide or work out of the box.

[BUG] Terraform fails to create write permissions on Event Hub namespace.

Describe the bug
Terraform fails to create write permissions on Event Hub namespace in the spring-cloud-azure-starter sample.

Exception or Stack Trace

Plan: 1 to add, 0 to change, 0 to destroy.
azurerm_role_assignment.role_eventhubs_data_owner: Creating...
╷
│ Error: authorization.RoleAssignmentsClient#Create: Failure responding to request: StatusCode=403 -- Original Error: autorest/azure: Service returned an error. Status=403 Code="AuthorizationFailed" Message="The client ****@****' with object id '#########' does not have authorization to perform action 'Microsoft.Authorization/roleAssignments/write' over scope '/subscriptions/#########/resourceGroups/rg-eventhubs-client-xmays/providers/Microsoft.EventHub/namespaces/ehn-eventhubs-client-ilkuo/eventhubs/eh1/providers/Microsoft.Authorization/roleAssignments/'#########' or the scope is invalid. If access was recently granted, please refresh your credentials."
│
│   with azurerm_role_assignment.role_eventhubs_data_owner,
│   on main.tf line 67, in resource "azurerm_role_assignment" "role_eventhubs_data_owner":
│   67: resource "azurerm_role_assignment" "role_eventhubs_data_owner" {
│
╵

To Reproduce

  1. Open Terminal.
  2. Navigate to azure-spring-boot-samples/eventhubs/spring-cloud-azure-starter-eventhubts/eventhubs-client

Code Snippet
N/A

Expected behavior
Create the write premission.

Screenshots
N/A

Setup (please complete the following information):

Additional context
n/a

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

[FEATURE REQ] Support starter and its sample for Key vault Certificate 4.0.0

Is your feature request related to a problem? Please describe.

As we can see in our reference doc:4.0.0

Spring Cloud Azure 4.0 supports health indicators for App Configuration, Event Hubs, Cosmos, Key Vault Certificate, Key Vault Secret, Storage Blob, Storage Queue, and Storage File Share.

But, we donot have starter and its sample for Key vault Certificate 4.0.0. So, to make our doc and artifacts compliant, we should supply a starter for Key Vault Certificate and one sample for it.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Description Added
  • Expected solution specified

Use Azure AD instead of AAD

Seems AAD is only used inside out team.

To make our sample more user friendly, we should use Azure AD instead of AAD. Including folder name and in README.md.

Here are the screen shots when I search Azure AD and AAD by google:
image
image

Tasks about updating links in spring.io

Context
We should update the link of https://spring.io/projects/spring-cloud-azure#samples when sample is adjusted.
Now the link in https://spring.io/projects/spring-cloud-azure#samples is azure-spring-boot-samples.
image

Task

  1. Rename folder name from aad to azure active directory
    now folder name aad is not consistant with offical doc, may be confusing.
    • rename folder @backwind1233
    • Update spring reference yaml
    • update links in samples, azure-sdk-for-java,azure-dev-docs-pr

[Query]

Query/Question
Azure Spring cloud dependency uses default 8080 port while sso redirect can we change the default port to 8443
note : i have use server.port =8443 to change the port but still redirects to port 8080
Why is this not a Bug or a feature Request?

Setup (please complete the following information if applicable):

  • OS:
  • IDE:
  • Sample Path:
  • Library/Libraries:

Information Checklist

  • Query Added
  • Setup information Added

Spring boot azure keyvault refresh on demand

I am using spring boot with azure's keyvault

        <dependency>
			<groupId>com.azure.spring</groupId>
			<artifactId>azure-spring-boot-starter-keyvault-secrets</artifactId>
		</dependency>

but there is a problem, when I want to update secret.
How to force for example via rest api lets say, refresh of this value ?

@Value("${x-value}") private val xValue: String = "0"
thanks!

Update MS doc about how to use Microsoft identity platform in application developed by Spring framework

Context

Now here are a lot of MS docs about Managed identity and Spring framework, but these pages didn't give the best solution. For example: these paged should introduce spring-security or spring-cloud-azure-azure-active-directory.

  1. Add spring-security related sample here: https://docs.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-asp-webapp
    image

  2. Add spring-security related sample here: https://docs.microsoft.com/en-us/azure/developer/java/spring-framework/spring-boot-starter-for-azure-active-directory-developer-guide
    image

  3. Add spring-security related sample here: https://docs.microsoft.com/en-us/azure/active-directory/develop/sample-v2-code

Problem

Not provide the best solution in these pages may misleading our customers.

Goal

Make MS docs give the best solution about using Microsoft identity platform in Spring Boot application.

Problems in azure-spring-boot-starter-keyvault-secrets

  • The sample talks about how to load specific secrets or all secrets from a Key Vault. What it doesn't say is that the user won't be able to access said secrets's properties, only their values, which will be loaded as properties of the Spring app.
  • The application.properties sample includes a couple properties that are mentioned for the first time here:
    - azure.keyvault.authority-host 
    - azure.keyvault.secret-service-version 
    
  • The explanation about what these properties do can be improved, more specifically, the grammar/redaction. We could even have a table explaining what all of the properties do in the main README.
  • I'm not sure why there are exmaples of how to set certificate-based app authentication, but it is a welcome section.
  • The note for this section refers a PR when it talks about how the certificates are handled by MSAL, however, I think said link does not provide much context but instead shows the exact changes that cause the behavior described in the note.
  • The Troubleshooting, Next Steps and Contributing sections are empty and they should not be.

[BUG] Event Consumer throws an error when deployed in azure cluster

Describe the bug
https://github.com/Azure-Samples/azure-spring-boot-samples/tree/spring-cloud-azure_v4.2.0/eventhubs/spring-cloud-azure-stream-binder-eventhubs/eventhubs-binder
The code sample present with above link works totally fine in my local using service principal. But it fails to consume while running in azure pipeline.

Exception or Stack Trace

"class":"c.a.s.i.e.i.EventHubsInboundChannelAdapter","message":"Error occurred on partition: NONE. Error: {} com.azure.storage.blob.models.BlobStorageException: If you are using a StorageSharedKeyCredential, and the  
server returned an error message that says 'Signature did not match', you can compare the string to sign with the one generated by the SDK. To log the string to sign, pass in the context key value pair          
'Azure-Storage-Log-String-To-Sign': true to the appropriate method call.nIf you are using a SAS token, and the server returned an error message that says 'Signature did not match', you can compare the string to sign 
  with the one generated by the SDK. To log the string to sign, pass in the context key value pair 'Azure-Storage-Log-String-To-Sign': true to the appropriate generateSas method call.nPlease remember to disable    
  'Azure-Storage-Log-String-To-Sign' before going to production as this string can potentially contain PII.nStatus code 403, \"<?xml version=\"1.0\" encoding=\"utf-8\"?  
  ><Error><Code>AuthorizationFailure</Code><Message>This request is not authorized to perform this operation.nRequestId:ef6b4624-001e-0001-7838-7fce5e000000nTime:2022-06-13T15:14:18.3797615Z</Message></Error>\"n\tat 
  java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:729)n\tat com.azure.core.http.rest.ResponseExceptionConstructorCache.invoke(ResponseExceptionConstructorCache.java:56)n\tat com.azure.core.
  http.rest.RestProxy.instantiateUnexpectedException(RestProxy.java:439)n\tat com.azure.core.http.rest.RestProxy.lambda$ensureExpectedStatus$2(RestProxy.java:393)n\tat reactor.core.publisher.
  FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:113)n\tat reactor.core.publisher.Operators$ScalarSubscription.request(Operators.java:2397)n\tat reactor.core.publisher.
  FluxMapFuseable$MapFuseableSubscriber.request(FluxMapFuseable.java:169)n\tat reactor.core.publisher.Operators$MultiSubscriptionSubscriber.set(Operators.java:2193)n\tat reactor.core.publisher.
  Operators$MultiSubscriptionSubscriber.onSubscribe(Operators.java:2067)n\tat reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onSubscribe(FluxMapFuseable.java:96)n\tat reactor.core.publisher.MonoJust.
  subscribe(MonoJust.java:54)n\tat reactor.core.publisher.InternalMonoOperator.subscribe(InternalMonoOperator.java:64)n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:157)n\tat reactor.core.
  publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:120)n\tat reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)n\tat reactor.core.publisher.Operators$MonoSubscriber.complete
  (Operators.java:1815)n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)n\tat reactor.core.publisher.FluxDelaySubscription$DelaySubscriptionMainSubscriber.onNext(FluxDelaySubscription.
  java:188)n\tat reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)n\tat reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.java:99)n\tat reactor.core.publisher.
  FluxTimeout$TimeoutMainSubscriber.onNext(FluxTimeout.java:179)n\tat reactor.core.publisher.Operators$MonoSubscriber.complete(Operators.java:1815)n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.
  java:151)n\tat reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.complete(MonoIgnoreThen.java:284)n\tat reactor.core.publisher.MonoIgnoreThen$ThenIgnoreMain.onNext(MonoIgnoreThen.java:187)n\tat reactor.core.
  publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)n\tat reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127)n\tat reactor.core.publisher.
  Operators$MonoSubscriber.complete(Operators.java:1815)n\tat reactor.core.publisher.MonoFlatMap$FlatMapMain.onNext(MonoFlatMap.java:151)n\tat reactor.core.publisher.SerializedSubscriber.onNext(SerializedSubscriber.
  java:99)n\tat reactor.core.publisher.FluxRetryWhen$RetryWhenMainSubscriber.onNext(FluxRetryWhen.java:173)n\tat reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79)n\tat 
  reactor.core.publisher.Operators$MonoInnerProducerBase.complete(Operators.java:2663)n\tat reactor.core.publisher.MonoSingle$SingleSubscriber.onComplete(MonoSingle.java:180)n\tat reactor.core.publisher.
  MonoFlatMapMany$FlatMapManyInner.onComplete(MonoFlatMapMany.java:260)n\tat reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:150)n\tat reactor.core.publisher.
  FluxDoFinally$DoFinallySubscriber.onComplete(FluxDoFinally.java:145)n\tat reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onComplete(FluxMapFuseable.java:150)n\tat reactor.core.publisher.
  Operators$MonoSubscriber.complete(Operators.java:1816)n\tat reactor.core.publisher.MonoCollect$CollectSubscriber.onComplete(MonoCollect.java:159)n\tat reactor.core.publisher.FluxHandle$HandleSubscriber.onComplete
  (FluxHandle.java:212)n\tat reactor.core.publisher.FluxMap$MapConditionalSubscriber.onComplete(FluxMap.java:269)n\tat reactor.netty.channel.FluxReceive.onInboundComplete(FluxReceive.java:401)n\tat reactor.netty.
  channel.ChannelOperations.onInboundComplete(ChannelOperations.java:416)n\tat reactor.netty.channel.ChannelOperations.terminate(ChannelOperations.java:470)n\tat reactor.netty.http.client.HttpClientOperations.
  onInboundNext(HttpClientOperations.java:685)n\tat reactor.netty.channel.ChannelOperationsHandler.channelRead(ChannelOperationsHandler.java:94)n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead
  (AbstractChannelHandlerContext.java:379)n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)n\tat io.netty.channel.AbstractChannelHandlerContext.
  fireChannelRead(AbstractChannelHandlerContext.java:357)n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)n\tat datadog.trace.
  instrumentation.netty41.client.HttpClientResponseTracingHandler.channelRead(HttpClientResponseTracingHandler.java:45)n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.
  java:251)n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead
  (AbstractChannelHandlerContext.java:365)n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)n\tat io.netty.channel.
  CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:436)n\tat io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:324)n\tat 
  io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:296)n\tat io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:251)n\tat io.netty.channel.
  AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)n\tat io.netty.
  channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)n\tat io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1368)n\tat io.netty.handler.ssl.SslHandler.decodeJdkCompatible
  (SslHandler.java:1234)n\tat io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1280)n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:507)n\tat io.netty.
  handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:446)n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)n\tat io.netty.channel.
  AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)n\tat io.netty.

To Reproduce
Deploy from local to azure pipeline

Code Snippet
https://github.com/Azure-Samples/azure-spring-boot-samples/tree/spring-cloud-azure_v4.2.0/eventhubs/spring-cloud-azure-stream-binder-eventhubs/eventhubs-binder

Expected behavior
Events should be picked by consumer

Screenshots

Setup (please complete the following information):

  • OS:
  • IDE:
  • Sample Path:
  • Library/Libraries:
  • Java version:
  • App Server/Environment:
  • Frameworks:

Additional context

Information Checklist

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Github actions check failed

in this repo, there are two github actions failed for a few days, the errors are:

  1. too many checkstyle errors
  2. incorrectted markdown broken links check

Sample errors
image

In Windows PowerShell, the sample does not work properly

When running terraform init in Powershell, I get the following error:

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/azurerm versions matching ">= 2.75.0"...
- Finding aztfmod/azurecaf versions matching "1.2.10"...
- Installing hashicorp/azurerm v2.93.1...
- Installing aztfmod/azurecaf v1.2.10...
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/azurerm v2.93.1: mkdir .terraform: The filename or extension is too long.
╵

╷
│ Error: Failed to install provider
│
│ Error while installing aztfmod/azurecaf v1.2.10: mkdir .terraform: The filename or extension is too long.
╵

Not getting this error after upgrading Terraform to the latest version.

[QUERY] How to set the visibility timeout and checkpoint mode on StorageQueueTemplate?

Query/Question
Earlier up to version 2.14.0 of the spring integration library for Azure Storage Queue, the StorageQueueMessageSource used to take a StorageQueueOperation object. This was replaced by StorageQueueTemplate in version 4.0.0
The earlier StorageQueueOperation object allowed us to set the checkpoint mode and visibility timeout
These setters are missing in StorageQueueTemplate object
How do I set these values when working with StorageQueueTemplate?
Also the StorageQueueMessageSource seems to always all the underlying StorageQueueTemplate with a visibilityTimeout that is set to null!

Why is this not a Bug or a feature Request?
At this point this is just a question. Depending on the response, this may be followed up with a feature request.

Setup (please complete the following information if applicable):

Information Checklist

  • Query Added
  • Setup information Added

[BUG] Unnecessary lines in terraform script

Describe the bug
For the following file:
https://github.com/Azure-Samples/azure-spring-boot-samples/blob/main/cosmos/spring-cloud-azure-starter-cosmos/spring-cloud-azure-cosmos-sample/terraform/main.tf


resource "azurerm_cosmosdb_sql_role_definition" "role" {
  name                = "cosmosdb-sql-role-definition"
  resource_group_name = azurerm_resource_group.main.name
  account_name        = azurerm_cosmosdb_account.application.name
  type                = "BuiltInRole"
  assignable_scopes   = ["/subscriptions/${data.azurerm_client_config.current.subscription_id}/resourceGroups/${azurerm_resource_group.main.name}/providers/Microsoft.DocumentDB/databaseAccounts/${azurerm_cosmosdb_account.application.name}"]

  permissions {
    data_actions = ["Microsoft.DocumentDB/databaseAccounts/readMetadata",
      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read",
      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/executeQuery",
      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readChangeFeed",
      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/*",
      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/*"]
  }
}

The following lines are duplicated:

      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/items/read",
      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/executeQuery",
      "Microsoft.DocumentDB/databaseAccounts/sqlDatabases/containers/readChangeFeed",

Exception or Stack Trace
Add the exception log and stack trace if available

To Reproduce
Steps to reproduce the behavior:

Code Snippet
Add the code snippet that causes the issue.

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: [e.g. iOS]
  • IDE: [e.g. IntelliJ]
  • Library/Libraries: [e.g. com.azure.spring:spring-cloud-azure-starter-keyvault-secrets:4.0.0 (groupId:artifactId:version)]
  • Java version: [e.g. 8]
  • App Server/Environment: [e.g. Tomcat, WildFly, Azure Function, Apache Spark, Databricks, IDE plugin or anything special]
  • Frameworks: [e.g. Spring Boot, Micronaut, Quarkus, etc]

If you suspect a dependency version mismatch (e.g. you see NoClassDefFoundError, NoSuchMethodError or similar), please check out Troubleshoot dependency version conflict article first. If it doesn't provide solution for the problem, please provide:

  • verbose dependency tree (mvn dependency:tree -Dverbose)
  • exception message, full stack trace, and any available logs

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Determine the content of readme and terraform template

Goal
Address Issues from feedback about template of readme and terraform scripts.

Context
This is from PR: #137


Problem Context
It maybe confused about the project root. image
Authenticate Using the Azure CLI -> Authenticate by Azure CLI(User principal) - Follow the Capitalization Rules to Capitalize the title.
setup -> set up image
Your browser window will open and -> Your browser window will open, and image
After successful authentication, your terminal will display your subscription information. Here is sample output: image
image
The terraform destroy command terminates resources managed by your Terraform project.
To destroy the resources you created.
->
Run the following Terraform command to destroy the related resources:
image
image

Redesign the sample about storage resource

Context
Now the sample code in about storage is not a good practice with spring resource,
we need to redesign and refactor with spring resource ResourceLoader and resolver interface.

[Query] Consumer with Listener for Storage queues

Query/Question
I'm looking to implement a consumer with a listener for storage queue. I referred to this branch ( https://github.com/Azure-Samples/azure-spring-boot-samples/tree/main/storage ) and did not find any implementation for listener. Could you please help to find any implementation?

Why is this not a Bug or a feature Request?
A clear explanation of why is this not a bug or a feature request?

Setup (please complete the following information if applicable):

  • OS: [e.g. iOS]
  • IDE: [e.g. IntelliJ]
  • Library/Libraries: [e.g. com.azure:azure-core:1.16.0 (groupId:artifactId:version)]

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Query Added
  • Setup information Added

[Bug] multiple-namespaces throw exceptions when running in WSL with defaultCredential

The sample multiple-namespaces will throw exceptions when running in WSL


.servicebus.windows.net. ERROR CONTEXT: N/A]emented: com.azure.core.amqp.exception.AmqpException: errorContext[NAMESPACE: sb-multiple-namespaces-servicebus-chmnf
.servicebus.windows.net. ERROR CONTEXT: N/A]pException: errorContext[NAMESPACE: sb-multiple-namespaces-servicebus-chmnf
        at com.azure.core.amqp.implementation.ExceptionUtil.toException(ExceptionUtil.java:85) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at com.azure.core.amqp.implementation.handler.ConnectionHandler.notifyErrorContext(ConnectionHandler.java:325) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at com.azure.core.amqp.implementation.handler.ConnectionHandler.onTransportError(ConnectionHandler.java:228) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:191) ~[proton-j-0.33.8.jar:na]
        at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) ~[proton-j-0.33.8.jar:na]
        at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324) ~[proton-j-0.33.8.jar:na]
        at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291) ~[proton-j-0.33.8.jar:na]
        at com.azure.core.amqp.implementation.ReactorExecutor.run(ReactorExecutor.java:92) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.4.9.jar:3.4.9]
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.4.9.jar:3.4.9]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
        at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]

.servicebus.windows.net], connectionId[MF_2eb2f4_1641443489437], error[null]onnectionHandler      : onTransportError hostname[sb-multiple-namespaces-servicebus-chmnf
2022-01-06 12:31:42.659 ERROR 4893 --- [ctor-executor-2] reactor.core.publisher.Operators         : Operator called default onErrorDropped

.servicebus.windows.net. ERROR CONTEXT: N/A]emented: com.azure.core.amqp.exception.AmqpException: errorContext[NAMESPACE: sb-multiple-namespaces-servicebus-chmnf
.servicebus.windows.net. ERROR CONTEXT: N/A]pException: errorContext[NAMESPACE: sb-multiple-namespaces-servicebus-chmnf
        at com.azure.core.amqp.implementation.ExceptionUtil.toException(ExceptionUtil.java:85) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at com.azure.core.amqp.implementation.handler.ConnectionHandler.notifyErrorContext(ConnectionHandler.java:325) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at com.azure.core.amqp.implementation.handler.ConnectionHandler.onTransportError(ConnectionHandler.java:228) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at org.apache.qpid.proton.engine.BaseHandler.handle(BaseHandler.java:191) ~[proton-j-0.33.8.jar:na]
        at org.apache.qpid.proton.engine.impl.EventImpl.dispatch(EventImpl.java:108) ~[proton-j-0.33.8.jar:na]
        at org.apache.qpid.proton.reactor.impl.ReactorImpl.dispatch(ReactorImpl.java:324) ~[proton-j-0.33.8.jar:na]
        at org.apache.qpid.proton.reactor.impl.ReactorImpl.process(ReactorImpl.java:291) ~[proton-j-0.33.8.jar:na]
        at com.azure.core.amqp.implementation.ReactorExecutor.run(ReactorExecutor.java:92) ~[azure-core-amqp-2.3.4.jar:2.3.4]
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:68) ~[reactor-core-3.4.9.jar:3.4.9]
        at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) ~[reactor-core-3.4.9.jar:3.4.9]
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) ~[na:na]
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
        at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]


How to reproduce this issue:

  • follow this guide and run in WSL.

azure-spring-integration-sample-servicebus not working with msi/service principle

Please provide us with the following information:

This issue is for a: (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Updated the application-sp.yaml file with the required details:

      client-id: [service-principal-id]
      client-secret: [service-principal-secret]
      tenant-id: [tenant-id]
      resource-group: [resource-group]

After that ran the ServiceBusIntegrationApplication.java file which fails with the following error:

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'queueMessageChannelAdapter' defined in class path resource [com/azure/spring/sample/servicebus/QueueReceiveController.class]: Unsatisfied dependency expressed through method 'queueMessageChannelAdapter' parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'queueOperation' defined in class path resource [com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusQueueAutoConfiguration.class]: Unsatisfied dependency expressed through method 'queueOperation' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'queueClientFactory' defined in class path resource [com/azure/spring/cloud/autoconfigure/servicebus/AzureServiceBusQueueAutoConfiguration.class]: Unsatisfied dependency expressed through method 'queueClientFactory' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.azure.spring.integration.servicebus.factory.ServiceBusConnectionStringProvider' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}

I tried adding the following piece of code to the QueueControllers:

@Bean
@ServiceActivator(inputChannel = OUTPUT_CHANNEL)
public ServiceBusConnectionStringProvider serviceBusConnectionStringProvider(){
 return new ServiceBusConnectionStringProvider(connectionString);
}

But the issue is that ServiceBusConnectionStringProvider can only be created with connectionString and for msi/sp mode we don't have that info.

Actually even the normal case was not working till I created this bean (Updating application.yaml).

Any log messages given by the failure

As given above

Expected/desired behavior

Putting those properties in the yaml file shouldn't have thrown that error.

OS and Version?

macOS Catalina

Versions

10.15.7

Mention any other details that might be useful


Thanks! We'll be in touch soon.

Update MS docs: Spring Cloud Azure 4.0

Target page:

Note that your PR should be a draft PR before 4.0 GA. And assign @chenrujun as assignee in your created draft PR.

Tasks

Before GA release.

  1. Update project name to Spring Cloud Azure.
  2. Update artifactId and version. (4.0 GA version)
  3. Update package name / class name.
  4. Update property prefix.
  5. Add link to reference doc: https://microsoft.github.io/spring-cloud-azure

After GA release

  1. Change link in MS docs into tag instead of version. For example, link to azure-sdk-for-java repo, azure-spring-boot-samples repo.

Sub Tasks

Screenshot of sub tasks

image
image

Sub task table

❌ : Not Finished.
✔️ : Finished.

Sub page GitHub Issue assignee page updated ? QA tested?
Spring on Azure #97 @Netyyyy ✔️
Spring Boot Starters for Azure #98 @hui1110 ✔️
Spring Security #99 @chenrujun
Messaging #100 @yiliuTo
Storage and database #101 @backwind1233 ✔️

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.