-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Storage identity remove resource manager provider #15837
Changes from 1 commit
03f8ab4
7266ac5
0de9b40
3964b68
9fb49ba
9acd2b9
bedcf50
9ad8a79
f9adbe0
9cac0d3
c2bbb46
41f32fa
8c1297b
f0322af
8a6385c
9305ee1
92fd3dd
06d8aa9
723e463
62c5533
b96c739
3f7e8ac
670e4a2
cfef365
f7f9414
9662b85
6f780a9
ef3f807
525c5b4
7d7adb1
80a9e20
9277d71
e4608d5
42d5e50
29beabc
969353e
bbc811e
01b1378
cc74b40
cdb5ed4
bccd6e2
9a206f1
f19af87
7bec935
456d383
9b1792b
fcb8bc8
a6cfcfe
8277c89
005e67f
552af0c
2456b26
8558375
dde0594
2a7d5a3
5531c84
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,13 +10,17 @@ | |
|
||
# Storage account name length should be between 3 and 24 | ||
# and use numbers and lower-case letters only. | ||
spring.cloud.azure.storage.account=accountName | ||
spring.cloud.azure.storage.account=ybstortst2 | ||
|
||
spring.cloud.azure.resource-group=test | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. resource group name should be replaced with some placeholder |
||
|
||
# Change into your containerName and blobName | ||
blob=azure-blob://containerName/blobName | ||
blob=azure-blob://ybstrcntnr/testblob.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. blob uri should be replaced with some placeholder |
||
|
||
# Default environment is GLOBAL. Provide your own if in another environment | ||
# Example environment is China, GLOBAL | ||
# spring.cloud.azure.environment=[environment] | ||
# Example region is westUS, northchina | ||
spring.cloud.azure.region=centralus | ||
spring.cloud.azure.region=eastus2 | ||
|
||
spring.cloud.azure.auto-create-resources=true |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package com.microsoft.azure.spring.cloud.autoconfigure.context; | ||
|
||
import java.util.Arrays; | ||
|
||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.boot.context.properties.EnableConfigurationProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.core.env.Environment; | ||
|
||
import com.azure.core.credential.TokenCredential; | ||
import com.azure.core.management.profile.AzureProfile; | ||
import com.azure.resourcemanager.Azure; | ||
import com.microsoft.azure.AzureEnvironment; | ||
import com.microsoft.azure.identity.spring.SpringEnvironmentTokenBuilder; | ||
import com.microsoft.azure.spring.cloud.context.core.config.AzureProperties; | ||
|
||
@Configuration | ||
@EnableConfigurationProperties(AzureProperties.class) | ||
@ConditionalOnClass(Azure.class) | ||
@ConditionalOnProperty(prefix = "spring.cloud.azure", value = { "resource-group" }) | ||
public class AzureResourceManager20AutoConfiguration { | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public com.azure.resourcemanager.Azure.Authenticated azure20(TokenCredential tokenCredential, | ||
AzureProperties azureProperties) { | ||
AzureEnvironment legacyEnvironment = azureProperties.getEnvironment(); | ||
com.azure.core.management.AzureEnvironment azureEnvironment = Arrays | ||
.stream(com.azure.core.management.AzureEnvironment.knownEnvironments()) | ||
.filter(env -> env.getManagementEndpoint().equals(legacyEnvironment.managementEndpoint())).findFirst() | ||
.get(); | ||
return com.azure.resourcemanager.Azure.authenticate(tokenCredential, new AzureProfile(azureEnvironment)); | ||
} | ||
|
||
@Bean | ||
@ConditionalOnMissingBean | ||
public TokenCredential tokenCredential(Environment environment) { | ||
return new SpringEnvironmentTokenBuilder().fromEnvironment(environment).build(); | ||
} | ||
} |
This file was deleted.
This file was deleted.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
account name should be replaced with some place holder