none
[Java][Azure Recource Management] ARM java SDK RRS feed

Answers

  • Hi,

    Thanks for posting here!

    I see the master branch of the repository of Azure SDK for Java on GitHub was updated that's different from the previous branch, but it seems to be a beta version.

    I suggest that using the stable version like the '0.9.x' version is the correct choice for development and working. You can move the maven repository of Azure SDK for Java at the http://mvnrepository.com/artifact/com.microsoft.azure/azure-svc-mgmt and import the maven dependency or jar file to your project.

    Hope it helps.

    Best Regards.

    Friday, May 20, 2016 7:40 AM
    Moderator

All replies

  • Hello,

    Thank you for posting here!

    Can you please provide us the exact error message what you are getting and the screenshot of that error message?

    And also, can you explain, what changing you are facing on the same?

    And what exactly you want to achieve?

    Regards,

    Swikruti

    If a post answers your question, please click Mark as Answer on that post and Vote as Helpful.
    Thursday, May 19, 2016 2:02 PM
  • Hi,

    Thanks for posting here!

    I see the master branch of the repository of Azure SDK for Java on GitHub was updated that's different from the previous branch, but it seems to be a beta version.

    I suggest that using the stable version like the '0.9.x' version is the correct choice for development and working. You can move the maven repository of Azure SDK for Java at the http://mvnrepository.com/artifact/com.microsoft.azure/azure-svc-mgmt and import the maven dependency or jar file to your project.

    Hope it helps.

    Best Regards.

    Friday, May 20, 2016 7:40 AM
    Moderator
  • Hello,

    Did you find this documentation about Azure Resource Manager SDK for Java :

    https://azure.microsoft.com/en-us/documentation/articles/resource-manager-java-sdk/

    Here you can find or file an issue :

    https://github.com/Azure/azure-sdk-for-java/issues

    Hope this information is useful for you.

    Best Regards,

    @Jamesvandenberg

    Saturday, May 21, 2016 10:06 AM
  • Hi,

    I used the below link for java SDK for Azure ARM authentication.
    https://azure.microsoft.com/en-us/documentation/articles/resource-manager-java-sdk/

    In the above link mentioned that "AuthHelper.getAccessTokenFromServicePrincipalCredentials" used for authentication. But the AuthHelper class not available in below java docs link and also " ServicePrincipalExample" link showing some error.

    When I check this " GitHub Azure Java SDK repository" link "https://github.com/azure/azure-sdk-for-java" show the below code for authentication.

    ResourceManagementClient client = new ResourceManagementClientImpl(
        new ApplicationTokenCredentials("client-id", "tenant-id", "secret", null) // see Authentication
    );
    client.setSubscriptionId(System.getenv("subscription-id"));
    client.setLogLevel(HttpLoggingInterceptor.Level.BODY);

    ResourceGroup group = new ResourceGroup();
    group.setLocation("West US");
    client.getResourceGroups().createOrUpdate("myresourcegroup", group);
    Question

    1) "ApplicationTokenCredentials" class is not available in java docs. Where can I find this class. Which jar I need to import

    2) Can you please give example code for this authentication

    Previously I used the below code for authentication

     ManagementConfiguration.configure(null,new URI(baseUri),"<subscriptionID>", getCredentials().getAccessToken());

     private static AuthenticationResult getCredentials() throws ServiceUnavailableException, MalformedURLException, ExecutionException, InterruptedException
     {
      AuthenticationContext context;
      AuthenticationResult result = null;
      ExecutorService service = null;
      try
      {
       service = Executors.newFixedThreadPool(1);
       context = new AuthenticationContext("https://login.windows.net/<tenant_id>",false, service);
       ClientCredential cred = new ClientCredential("<Client_ID>","<client_key>");
       Future<AuthenticationResult> future = context.acquireToken("https://management.azure.com/", cred, null);
       result = future.get();
      }
      finally
       service.shutdown();
      if (result == null) {throw new ServiceUnavailableException("authentication result was null");}
      return result;
     }

    1) Which one is the correct way to follow . Please explain this in detail with example available.


    Thanks & Regards

    Rathidevi









    rathidevi


    Friday, June 10, 2016 6:43 AM