Skip to content

Conversation

@utkarsh-dixit
Copy link
Collaborator

@utkarsh-dixit utkarsh-dixit commented Nov 13, 2025

Add Azure Blob Storage Support for File Uploads

This PR adds support for Azure Blob Storage when uploading files. Key changes:

  • Modified the upload function to accept an is_azure parameter
  • Added the required x-ms-blob-type: BlockBlob header when uploading to Azure
  • Updated the status code check to include 201 as a successful response
  • Modified the file upload process to check for an x-is-azure-storage header in the response
  • Changed the response handling to parse JSON directly instead of using the cast_to parameter

Note

Cursor Bugbot is generating a summary for commit ab0adb9. Configure here.

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@macroscopeapp
Copy link

macroscopeapp bot commented Nov 13, 2025

Add Azure upload support by conditionally sending x-ms-blob-type: BlockBlob and accepting HTTP 201 in composio.core.models._files.upload for the Composio Python SDK

Introduce an is_azure flag to composio.core.models._files.upload to gate the x-ms-blob-type: BlockBlob header and broaden success codes to 200, 201, 403; determine is_azure in composio.core.models._files.FileUploadable.from_path from the x-is-azure-storage response header and pass it to upload after parsing JSON from the presign response.

📍Where to Start

Start with FileUploadable.from_path in python/composio/core/models/_files.py to see how is_azure is derived and propagated to upload.


Macroscope summarized ab0adb9.


s3meta = s3meta_response.json()
is_azure = s3meta_response.headers.get("x-is-azure-storage") == "true"
if not upload(url=s3meta.new_presigned_url, file=file, is_azure=is_azure):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Type Change Breaks Object Attribute Access

After changing from cast_to=_FileUploadResponse to calling .json(), s3meta is now a dictionary rather than a _FileUploadResponse object. The code on lines 140 and 142 attempts to access s3meta.new_presigned_url and s3meta.key using attribute notation, which fails on dictionaries. Dictionary access requires bracket notation like s3meta['new_presigned_url'] and s3meta['key'].

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants