azure
azure copied to clipboard
Azure_rm_storageblob - Share key authorization support
SUMMARY Share key authorization support, see https://docs.microsoft.com/en-us/azure/storage/common/storage-auth , Shared Key authorization.
ISSUE TYPE Feature Idea COMPONENT NAME azure_rm_storageblob module
ADDITIONAL INFORMATION Need to accept access_key parameter which is the value of shared authorization key
- name: Remove container foo
azure_rm_storageblob:
resource_group: testing
storage_account_name: clh0002
container: foo
access_key: "{{ my_access_key }}"
state: present
by @melezhik from https://github.com/ansible/ansible/issues/55350
@lukasmrtvy Thanks for your submit this issue! We will investigate and add this feature! You are also welcome to add this feature!
Hey, I'm also up'ing this, it's weird since the powershell module has support for Access Key yet the ansible module doesn't.
Any news on this?
As a workaround, I used the builtin uri module. The Azure API is quite simple to use with the shared access tokens.
I used something like this, with my SAS URL cut in two environment variable, before and after the ?.
....
vars:
blob_name: yourblobname
azure_sas_url: "{{ lookup('env', 'AZURE_SAS_URL') }}"
azure_sas_token: "{{ lookup('env', 'AZURE_SAS_TOKEN') }}"
tasks:
- name: Upload blob to Azure
ansible.builtin.uri:
url: "{{ azure_sas_url }}/{{ blob_name }}?{{ azure_sas_token }}"
method: PUT
headers:
x-ms-blob-type: BlockBlob
src: "yourfile"
status_code: 201