I have a container in Azure blob storage with the Access Policy set to "Blob". The container has existing blobs that I would like to protect with a Shared Access Policy.
I noticed if I create a container shared access policy...
var sharedPolicy = new SharedAccessBlobPolicy()
{
SharedAccessExpiryTime = DateTime.UtcNow.AddMinutes(120),
Permissions = SharedAccessBlobPermissions.Read | SharedAccessBlobPermissions.Write
};
permissions.SharedAccessPolicies.Add(Guid.NewGuid().ToString(), sharedPolicy);
_blobContainer.SetPermissions(permissions);
I am still able to read the existing blobs. I expected the existing blobs to be "protected" by the newly created SAP.
How can I apply a SAP to an existing blob?
Can all SAP's be removed from a container to expose all the blobs publicly again (assuming you know the url)? Or does removing the SAP make the blobs inaccessible somehow?
If I am using SAP's to protect the blobs, can I set the container's Access Policy to "private" and have it still work?
Thanks!