Azure / azure-storage-java

Microsoft Azure Storage Library for Java
https://docs.microsoft.com/en-us/java/api/overview/azure/storage
MIT License
189 stars 163 forks source link

RoleEnvironment is missing. #267

Open cjemison opened 6 years ago

cjemison commented 6 years ago

I am new to the azure platform, so this is a newbie question.

Most of the documentation for the blob store has a reference for RoleEnvironment. When using this gradle dependency: compile group: 'com.microsoft.azure', name: 'azure-storage', version: '7.0.0'

I can't seem to find this class and an exception is thrown. I can't find this class.

The link on google points to https://azure.github.io/azure-sdk-for-java/com/microsoft/windowsazure/serviceruntime/RoleEnvironment.html but the link is missing

mirobers commented 6 years ago

RoleEnvironment was a part of the Azure SDK. Storage libraries don't depend on it, so your gradle reference won't bring it in. Could you share a link to the docs? They may need to be updated.

cjemison commented 6 years ago

https://docs.microsoft.com/en-us/azure/storage/blobs/storage-java-how-to-use-blob-storage

@mirobers Can you tell me what is the library that I am suppose to use? I am looking for the gradle dependency.

mirobers commented 6 years ago

Thanks for the link! @seguler to follow up on the documentation.

@cjemison you can ignore RoleEnvironment and store your connection string as a string constant, which is also demonstrated in the docs. The rest of the examples in the documentation should work fine for you.

cjemison commented 6 years ago

@mirobers Is there another way to instantiate this? I don't want to put a connection string in my app/docker instance/git repository. AWS has a concept of InstanceEnvironment that gets a connection to dynamo, s3, etc through IAM rules and configuration.