0

Azure-java-sdk:8:3:0

I can not understand complete the uses of uploadPermissions() method (below is the signature of method). (com.microsoft.azure.storage.blob.CloudBlobContainer#uploadPermissions()) This method uploads two thing

  1. BlobContainerPublicAccessType (OFF | BLOB| CONTAINER)
  2. HashMap ==> sharedAccessBlobPolicyMap

I can understand the first thing that will be used to change the public access level of the container but unable to understand the 2nd thing (sharedAccessBlobPolicyMap ) that when the sharedAccessBlobPolicyMap will be used?

As per my understanding in Azure, blob policy is used while generating Shared Access Signature. Is there any other use of blob policy?

/**
     * Uploads the container's permissions using the specified request options and operation context.
     * 
     * @param permissions
     *            A {@link BlobContainerPermissions} object that represents the permissions to upload.
     * @param accessCondition
     *            An {@link AccessCondition} object that represents the access conditions for the container.
     * @param options
     *            A {@link BlobRequestOptions} object that specifies any additional options for the request. Specifying
     *            <code>null</code> will use the default request options from the associated service client (
     *            {@link CloudBlobClient}).
     * @param opContext
     *            An {@link OperationContext} object that represents the context for the current operation. This object
     *            is used to track requests to the storage service, and to provide additional runtime information about
     *            the operation.
     * 
     * @throws StorageException
     *             If a storage service error occurred.
     */
    @DoesServiceRequest
    public void uploadPermissions(final BlobContainerPermissions permissions, final AccessCondition accessCondition,
            BlobRequestOptions options, OperationContext opContext) throws StorageException 
Ajay Rai
  • 46
  • 5
  • Regarding sharedAccessBlobPolicyMap, it is used to set Azure blob share access policy. The policy specifies the start time, expiry time, and permissions for a shared access signature. Regarding shared access signature, please refer to https://learn.microsoft.com/en-us/rest/api/storageservices/delegate-access-with-shared-access-signature – Jim Xu Oct 10 '19 at 01:06
  • sharedAccessBlobPolicyMap contains an alias for every policy but java API to create SAS doesn't take any rathe it takes policy object again then what is the use of that alias. – Ajay Rai Oct 10 '19 at 08:32
  • The alias is the policy name. – Jim Xu Oct 10 '19 at 08:45
  • Do you have any other concerns? – Jim Xu Oct 10 '19 at 23:15
  • while generating sas it is taking "SharedAccessBlobPolicy" again not taking any alias (policyName) then where this alias will be used? – Ajay Rai Oct 11 '19 at 10:48
  • To make me better understand your issue, could you please provide the code you use. Regarding how to use the method ```uploadPermissions```, please refer to https://github.com/Azure-Samples/storage-blob-java-getting-started/blob/cc3c3d48e7e32f37bca408e3090fdf975b3a76ee/src/BlobAdvanced.java#L267 – Jim Xu Oct 14 '19 at 01:28
  • @JimXu Please summarize your inputs as an answer below so it helps others in the community. Thanks! – Bhargavi Annadevara Nov 01 '19 at 03:10

0 Answers0