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

Storage identity remove resource manager provider #15837

Closed
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
03f8ab4
In progress
mnriem Aug 5, 2020
7266ac5
Throw an exception when configuration is incomplete
mnriem Aug 6, 2020
0de9b40
Added class level JavaDoc
mnriem Aug 6, 2020
3964b68
Resolve POM conflict
mnriem Aug 6, 2020
9fb49ba
Added unit tests
mnriem Aug 6, 2020
9acd2b9
Merge branch 'credential-helper' of https://github.com/mnriem/azure-s…
yevster Aug 12, 2020
bedcf50
Changing the Identity Helper into a builder
yevster Aug 13, 2020
9ad8a79
Adding storage resource sample, autoconfiguration for blob storage wi…
yevster Aug 15, 2020
f9adbe0
Attempting to generate an endpoint string
yevster Aug 17, 2020
9cac0d3
Provisional workaround for using IdentityToken in Shared service conn…
yevster Aug 21, 2020
c2bbb46
Merge branch 'master' into storage-identity
yevster Aug 22, 2020
41f32fa
In progress
mnriem Aug 5, 2020
8c1297b
Throw an exception when configuration is incomplete
mnriem Aug 6, 2020
f0322af
Added class level JavaDoc
mnriem Aug 6, 2020
8a6385c
Resolve POM conflict
mnriem Aug 6, 2020
9305ee1
Added unit tests
mnriem Aug 6, 2020
92fd3dd
Changing the Identity Helper into a builder
yevster Aug 13, 2020
06d8aa9
Adding storage resource sample, autoconfiguration for blob storage wi…
yevster Aug 15, 2020
723e463
Attempting to generate an endpoint string
yevster Aug 17, 2020
62c5533
Provisional workaround for using IdentityToken in Shared service conn…
yevster Aug 21, 2020
b96c739
Merge branch 'storage-identity' of github.com:yevster/azure-sdk-for-j…
yevster Sep 14, 2020
3f7e8ac
XML syntax fix
yevster Sep 14, 2020
670e4a2
Storage resource demo works
yevster Sep 17, 2020
cfef365
Removing tight Resource Manager Provider coupling
yevster Sep 30, 2020
f7f9414
Merge branch 'master' into storage-identity-remove-resource-manager-p…
yevster Oct 2, 2020
9662b85
Fixing autoconfiguration for legacy resource management to not kick i…
yevster Oct 3, 2020
6f780a9
Merge branch 'master' into storage-identity-remove-resource-manager-p…
yevster Oct 8, 2020
ef3f807
Resource demo works with file legacy file credentail'
yevster Oct 15, 2020
525c5b4
Resource sample works with environment parameters
yevster Oct 15, 2020
7d7adb1
Removing debugging code
yevster Oct 15, 2020
80a9e20
Fixing SPEL expression to omit legacy auto-config when using Spring e…
yevster Oct 15, 2020
9277d71
checkstyle appeasement
yevster Oct 17, 2020
e4608d5
Checktyle appeasement, version fixing
yevster Oct 19, 2020
42d5e50
Adding mock token credentail to Actuator test config to ward off unea…
yevster Oct 20, 2020
29beabc
Adding mock token credentail to Actuator test config to ward off unea…
yevster Oct 21, 2020
969353e
Removing topic manager dependency from queue autoconfig
yevster Oct 22, 2020
bbc811e
Fixing autoconfig dependencies for Topic binders
yevster Oct 22, 2020
01b1378
Fixing startup failure when namespace is provided instead of connection
yevster Oct 28, 2020
cc74b40
Updating to incorporate upstream library signature changes
yevster Oct 28, 2020
cdb5ed4
Merge branch 'master' into storage-identity-remove-resource-manager-p…
saragluna Oct 28, 2020
bccd6e2
include version tag should be on the same line
saragluna Oct 28, 2020
9a206f1
Spring Cloud Stream - Event Hub binder demo now works
yevster Oct 28, 2020
f19af87
merging with master
yevster Oct 29, 2020
7bec935
Fixing build failures
yevster Oct 29, 2020
456d383
Preventing reliance on resource management bean when resource group
yevster Oct 30, 2020
9b1792b
Merge branch 'master' into storage-identity-remove-resource-manager-p…
yevster Oct 30, 2020
fcb8bc8
Fixing NPE in auto-configuration
yevster Oct 30, 2020
a6cfcfe
Fixing NPE in auto-configuration
yevster Oct 30, 2020
8277c89
Fixing package names broken in merge
yevster Oct 30, 2020
005e67f
Checkstyle appeasement
yevster Oct 30, 2020
552af0c
Checkstyle appeasement
yevster Oct 30, 2020
2456b26
Merge branch 'context-config-npe-fix' into storage-identity-remove-re…
yevster Oct 30, 2020
8558375
Eliminating ServiceBus ARM dependency when not pulled in thorugh sett…
yevster Oct 31, 2020
dde0594
Deleting duplicate sample
yevster Oct 31, 2020
2a7d5a3
Removing module for superfluous storage resource demeo
yevster Nov 2, 2020
5531c84
Fixing parent pom of identity library
yevster Nov 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Attempting to generate an endpoint string
  • Loading branch information
yevster committed Sep 14, 2020
commit 723e46326ee118748a415d56a75bf876e1082b3e
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Credential file based usage

spring.cloud.azure.credential-file-path=[credential-file-path]
spring.cloud.azure.resource-group=[resource-group]
# spring.cloud.azure.credential-file-path=[credential-file-path]
# spring.cloud.azure.resource-group=test

# Access key based usage

@@ -10,15 +10,15 @@ spring.cloud.azure.resource-group=[resource-group]

# Storage account name length should be between 3 and 24
# and use numbers and lower-case letters only.
spring.cloud.azure.storage.account=[account-name]
spring.cloud.azure.storage.account=ybstorgtest

# Change into your containerName and blobName
blob=azure-blob://containerName/blobName
blob=azure-blob://tainer/yevblob

# spring.cloud.azure.auto-create-resources=true
spring.cloud.azure.auto-create-resources=true

# 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=[region]
spring.cloud.azure.region=centralus
Original file line number Diff line number Diff line change
@@ -5,6 +5,7 @@
import com.microsoft.azure.AzureEnvironment;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.stream.Collectors;

public class StorageConnectionStringBuilder {
@@ -23,20 +24,33 @@ public class StorageConnectionStringBuilder {

private static final String SEPARATOR = ";";

public static String build(String accountName, String accountKey, AzureEnvironment environment, boolean
isSecureTransfer) {
private static String build(String accountName, Optional<String> accountKey, AzureEnvironment environment,
boolean isSecureTransfer) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Map<String, String> map = new HashMap<>();
map.put(DEFAULT_PROTOCOL, resolveProtocol(isSecureTransfer));
map.put(ACCOUNT_NAME, accountName);
map.put(ACCOUNT_KEY, accountKey);
// Remove starting dot since AzureEnvironment.storageEndpointSuffix() starts with dot

if (accountKey.isPresent()) {
map.put(ACCOUNT_KEY, accountKey.get());
}
// Remove starting dot since AzureEnvironment.storageEndpointSuffix() starts
// with dot
map.put(ENDPOINT_SUFFIX, environment.storageEndpointSuffix().substring(1));

return map.entrySet().stream().map(Object::toString).collect(Collectors.joining(SEPARATOR));
}

public static String build(String accountName, String accountKey, AzureEnvironment environment,
boolean isSecureTransfer) {
return build(accountName, Optional.of(accountKey), environment, isSecureTransfer);
}

public static String build(String accountName, String accountKey, AzureEnvironment environment) {
return build(accountName, accountKey, environment, true);
return build(accountName, Optional.of(accountKey), environment, true);
}

public static String build(String accountName, AzureEnvironment environment, boolean isSecureTransfer) {
return build(accountName, Optional.empty(), environment, isSecureTransfer);
}

private static String resolveProtocol(boolean isSecureTransfer) {
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@
import com.microsoft.azure.spring.cloud.autoconfigure.context.AzureContextAutoConfiguration;
import com.microsoft.azure.spring.cloud.context.core.api.EnvironmentProvider;
import com.microsoft.azure.spring.cloud.context.core.api.ResourceManagerProvider;
import com.microsoft.azure.spring.cloud.context.core.storage.StorageConnectionStringBuilder;
import com.microsoft.azure.spring.cloud.context.core.storage.StorageConnectionStringProvider;
import com.microsoft.azure.spring.cloud.storage.AzureStorageProtocolResolver;
import com.microsoft.azure.spring.cloud.telemetry.TelemetryCollector;
@@ -86,7 +87,10 @@ public BlobServiceClientBuilder blobServiceClientBuilder(AzureStorageProperties
} else {
TokenCredential defaultIdentityCredential = new SpringEnvironmentTokenBuilder().fromEnvironment(environment)
.defaultCredential().build();
authenticatedClientBuilder = new BlobServiceClientBuilder().credential(defaultIdentityCredential);
String connectionString = StorageConnectionStringBuilder.build(storageProperties.getAccount(),
environmentProvider.getEnvironment(), storageProperties.isSecureTransfer());
authenticatedClientBuilder = new BlobServiceClientBuilder().credential(defaultIdentityCredential)
.connectionString(connectionString);
}

return authenticatedClientBuilder