diff --git a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py index d04c1e4fb539..c78bcbb4de45 100644 --- a/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py +++ b/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/authentication.py @@ -115,7 +115,8 @@ def _get_canonicalized_resource_query(request): def _add_authorization_header(self, request, string_to_sign): try: - signature = sign_string(self.account_key, string_to_sign) + padding = '=' * (4 - len(self.account_key) % 4) + signature = sign_string(self.account_key + padding, string_to_sign) auth_string = 'SharedKey ' + self.account_name + ':' + signature request.http_request.headers['Authorization'] = auth_string except Exception as ex: diff --git a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py index d04c1e4fb539..c78bcbb4de45 100644 --- a/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py +++ b/sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_shared/authentication.py @@ -115,7 +115,8 @@ def _get_canonicalized_resource_query(request): def _add_authorization_header(self, request, string_to_sign): try: - signature = sign_string(self.account_key, string_to_sign) + padding = '=' * (4 - len(self.account_key) % 4) + signature = sign_string(self.account_key + padding, string_to_sign) auth_string = 'SharedKey ' + self.account_name + ':' + signature request.http_request.headers['Authorization'] = auth_string except Exception as ex: diff --git a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py index d04c1e4fb539..c78bcbb4de45 100644 --- a/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py +++ b/sdk/storage/azure-storage-file-share/azure/storage/fileshare/_shared/authentication.py @@ -115,7 +115,8 @@ def _get_canonicalized_resource_query(request): def _add_authorization_header(self, request, string_to_sign): try: - signature = sign_string(self.account_key, string_to_sign) + padding = '=' * (4 - len(self.account_key) % 4) + signature = sign_string(self.account_key + padding, string_to_sign) auth_string = 'SharedKey ' + self.account_name + ':' + signature request.http_request.headers['Authorization'] = auth_string except Exception as ex: diff --git a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py index d04c1e4fb539..c78bcbb4de45 100644 --- a/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py +++ b/sdk/storage/azure-storage-queue/azure/storage/queue/_shared/authentication.py @@ -115,7 +115,8 @@ def _get_canonicalized_resource_query(request): def _add_authorization_header(self, request, string_to_sign): try: - signature = sign_string(self.account_key, string_to_sign) + padding = '=' * (4 - len(self.account_key) % 4) + signature = sign_string(self.account_key + padding, string_to_sign) auth_string = 'SharedKey ' + self.account_name + ':' + signature request.http_request.headers['Authorization'] = auth_string except Exception as ex: