Storage identity remove resource manager provider#15837
Storage identity remove resource manager provider#15837yevster wants to merge 56 commits intoAzure:masterfrom
Conversation
…th default identity
…th default identity
…ava into storage-identity
…rovider Merging from master.
…n and break when attmepting to use 2.0 version of resource management
| <artifactId>azure-spring-boot-service</artifactId> | ||
| <version>1.0.0</version> | ||
| </parent> | ||
| <artifactId>azure-identity-spring-library</artifactId> |
There was a problem hiding this comment.
Suggest change the artifact id to azure-identity-spring
There was a problem hiding this comment.
@mnriem, any objection to eliminating the Spring Environment identity library entirely and moving this functionality to the azure-spring-cloud-context module?
| credentials.put(name, credential); | ||
| return; | ||
| } | ||
|
|
There was a problem hiding this comment.
For system assigned identity, tenant id is needed.
For user assigned identity, tenant id and one optional client id is needed.
Code here has some problems work with system assigned identity and user assigned identity.
There was a problem hiding this comment.
Would it be simpler to always fall back to DefaultAzureCredentialBuilder?
There was a problem hiding this comment.
For system assigned you do not need tenant id. User-assigned was not targeted and would need to be added if required.
| } catch (Throwable t) { | ||
| assertEquals(IllegalStateException.class, t.getClass(), | ||
| "Unexpected exception class on missing configuration field."); | ||
| } |
There was a problem hiding this comment.
We can use assertThrows() here.
There was a problem hiding this comment.
I prefer not to use Exception annotations for generic exceptions (e.g. IllegalStateException). Because these can be thrown from just about anywhere, it's important to ensure that it gets thrown from a particular place, not just anywhere in the test method.
| */ | ||
| public SpringEnvironmentTokenBuilder fromEnvironment(Environment environment) { | ||
| populateNamedCredential(environment, ""); | ||
| String credentialNamesKey = AZURE_CREDENTIAL_PREFIX + "names"; |
There was a problem hiding this comment.
Is it possible to consider make use of @ConfigurationProperties and model different credentials as Map, so that we don't need the 'names' here.
There was a problem hiding this comment.
This is a repackaging of @mnriem's code, so perhaps he can answer better. My understanding is that a custom map is needed because property values could come from multiple sources, and this serves to consolidate them in a single place.
There was a problem hiding this comment.
The 'names' defines the order of the chain.
|
|
||
| /** | ||
| * @author Warren Zhu | ||
| */ |
| # and use numbers and lower-case letters only. | ||
| spring.cloud.azure.storage.account=ybstortst2 | ||
|
|
||
| spring.cloud.azure.resource-group=test |
There was a problem hiding this comment.
resource group name should be replaced with some placeholder
| spring.cloud.azure.resource-group=test | ||
|
|
||
| # Change into your containerName and blobName | ||
| blob=azure-blob://ybstrcntnr/testblob.txt |
There was a problem hiding this comment.
blob uri should be replaced with some placeholder
| spring.cloud.azure.storage.account=springcloud | ||
|
|
||
| spring.cloud.azure.region=westUS | ||
| spring.cloud.azure.auto-create-resources=true |
There was a problem hiding this comment.
Better to use engineering system's capability to provision Azure resource dynamically. Better not to leave storage URL in config file.
| @AutoConfigureMockMvc | ||
| @TestPropertySource( | ||
| locations = "classpath:application-test.properties") | ||
| public class StorageApplicationIT { |
There was a problem hiding this comment.
Better to use dynamic provisioned Azure resource for test. SDK engineering system provide such capability.
It's also OK to remove test case for sample.
| @@ -1,90 +1,98 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
There was a problem hiding this comment.
Should use space instead of tab.
|
@yevster I've pushed a commit to your branch to solve conflicts. Please remember to pull before push if you want to add more commits. |
| @@ -0,0 +1,115 @@ | |||
| = Spring Cloud Azure Storage Starter Sample | |||
There was a problem hiding this comment.
We already have the sample in our samples, https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/spring/azure-spring-boot-samples/azure-spring-cloud-sample-storage-resource, so I suggest we remove this one.
There was a problem hiding this comment.
@yevster I've pushed a commit to your branch to solve conflicts. Please remember to pull before push if you want to add more commits.
@saragluna, I had in-flight changes fixing the event hub binders sample. Now, I see that sample, along with several others have been removed. May I ask why?
I'll try to schedule a meeting this morning (your time) to discuss.
parameter not set (i.e. that bean would not be initialized)
…source-manager-provider
|
is this still active? |
|
I think it can be closed. Because we use this PR instead: #17119 @saragluna , please close this PR if you think it's OK to close it. |
|
i'm closing this PR since it's been a long time inactive, please reopen if needed |
No description provided.