Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to use fileshare and blob together using connection-string (spring-cloud-azure 4.0.0) #28464

Closed
ctalpandey opened this issue Apr 22, 2022 · 3 comments
Assignees
Labels
azure-spring All azure-spring related issues azure-spring-storage Spring storage releated issues. bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team
Milestone

Comments

@ctalpandey
Copy link

ctalpandey commented Apr 22, 2022

Below is the application.yml (using spring-cloud-azure 4.0.0) which specifies both blob and fileshare:

spring:
  cloud:
    azure:
      storage:
        blob:
          account-name: "${AZURE_STORAGE_BLOB_ACCOUNT_NAME}"
          connection-string: "${AZURE_STORAGE_CONNECTION_STRING}"
        fileshare:
          account-name: "${AZURE_STORAGE_FILESHARE_ACCOUNT_NAME}"
          connection-string: "${AZURE_STORAGE_CONNECTION_STRING}"

Below is the errror.

2022-04-22 09:07:40.848  WARN 38200 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.support.BeanDefinitionOverrideException: Invalid bean definition with name 'staticStorageBlobConnectionStringProvider' defined in class path resource [com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.class]: Cannot register bean definition [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=com.azure.spring.cloud.autoconfigure.storage.fileshare.AzureStorageFileShareAutoConfiguration; factoryMethodName=staticStorageBlobConnectionStringProvider; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.class]] for bean 'staticStorageBlobConnectionStringProvider': There is already [Root bean: class [null]; scope=; abstract=false; lazyInit=null; autowireMode=3; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=com.azure.spring.cloud.autoconfigure.storage.blob.AzureStorageBlobAutoConfiguration; factoryMethodName=staticStorageBlobConnectionStringProvider; initMethodName=null; destroyMethodName=(inferred); defined in class path resource [com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.class]] bound.
2022-04-22 09:07:40.864  INFO 38200 --- [           main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-04-22 09:07:40.897 ERROR 38200 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   :

***************************
APPLICATION FAILED TO START
***************************

Description:

The bean 'staticStorageBlobConnectionStringProvider', defined in class path resource [com/azure/spring/cloud/autoconfigure/storage/fileshare/AzureStorageFileShareAutoConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [com/azure/spring/cloud/autoconfigure/storage/blob/AzureStorageBlobAutoConfiguration.class] and overriding is disabled.

Action:

Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

Note, it works if account-key is specified for both.

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Apr 22, 2022
@backwind1233 backwind1233 added the azure-spring All azure-spring related issues label Apr 24, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 24, 2022
@backwind1233 backwind1233 added Client This issue points to a problem in the data-plane of the library. needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. labels Apr 24, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Apr 24, 2022
@backwind1233
Copy link
Contributor

@ctalpandey Thanks for reaching us, I will look into it.

@backwind1233 backwind1233 added the azure-spring-storage Spring storage releated issues. label Apr 24, 2022
@ghost ghost added the needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team label Apr 24, 2022
@backwind1233 backwind1233 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Apr 24, 2022
@backwind1233 backwind1233 self-assigned this Apr 24, 2022
@backwind1233 backwind1233 added this to the [2022] May milestone Apr 24, 2022
@backwind1233 backwind1233 moved this from Todo to In Progress in Spring Cloud Azure Apr 24, 2022
@backwind1233 backwind1233 removed the question The issue doesn't require a change to the product in order to be resolved. Most issues start as that label Apr 25, 2022
@backwind1233
Copy link
Contributor

@ctalpandey We have fixed this issue in the PR, and will fix it in our next release.

@backwind1233 backwind1233 added the needs-author-feedback Workflow: More information is needed from author to address the issue. label Apr 26, 2022
@ctalpandey
Copy link
Author

Thank for the fix; closing issue from my side.

Repository owner moved this from In Progress to Done in Spring Cloud Azure Apr 26, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
azure-spring All azure-spring related issues azure-spring-storage Spring storage releated issues. bug This issue requires a change to an existing behavior in the product in order to be resolved. Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-author-feedback Workflow: More information is needed from author to address the issue. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team
Projects
Archived in project
Development

No branches or pull requests

2 participants