Assign role Storage Contributor to a VM with Java SDK

Stefanova Vesela (IOC/PDL-TQ) 1 Reputation point
2020-11-16T11:43:52.013+00:00

Hello all, I am currently writing a Java program that creates a VM and wants to download a file from a storage into the VM. Therefore I need to assign access to the VM with role Storage blob data contributor. However, I cannot seem to be able to find how this is possible with the Java SDK (I found the RoleAssignment Documentation, but there are no examples). Can someone point me to the right direction or provide me with an example code snippet?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,991 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,220 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 37,416 Reputation points Microsoft Employee
    2020-11-16T20:29:36.107+00:00

    @Stefanova Vesela (IOC/PDL-TQ)
    There is a sample available here which I believe is what you are looking for. You will probably find the REST API example helpful to better understand some of the terms.

    Hope this helps. Let us know if you need further assistance or have further questions.

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.