azure-storage-file-share-py
Azure Storage File Share SDK for Python. Use for SMB file shares, directories, and file operations in the cloud.
Best use case
azure-storage-file-share-py is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Azure Storage File Share SDK for Python. Use for SMB file shares, directories, and file operations in the cloud.
Teams using azure-storage-file-share-py should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/azure-storage-file-share-py/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How azure-storage-file-share-py Compares
| Feature / Agent | azure-storage-file-share-py | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Azure Storage File Share SDK for Python. Use for SMB file shares, directories, and file operations in the cloud.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Azure Storage File Share SDK for Python
Manage SMB file shares for cloud-native and lift-and-shift scenarios.
## Installation
```bash
pip install azure-storage-file-share
```
## Environment Variables
```bash
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...
# Or
AZURE_STORAGE_ACCOUNT_URL=https://<account>.file.core.windows.net
```
## Authentication
### Connection String
```python
from azure.storage.fileshare import ShareServiceClient
service = ShareServiceClient.from_connection_string(
os.environ["AZURE_STORAGE_CONNECTION_STRING"]
)
```
### Entra ID
```python
from azure.storage.fileshare import ShareServiceClient
from azure.identity import DefaultAzureCredential
service = ShareServiceClient(
account_url=os.environ["AZURE_STORAGE_ACCOUNT_URL"],
credential=DefaultAzureCredential()
)
```
## Share Operations
### Create Share
```python
share = service.create_share("my-share")
```
### List Shares
```python
for share in service.list_shares():
print(f"{share.name}: {share.quota} GB")
```
### Get Share Client
```python
share_client = service.get_share_client("my-share")
```
### Delete Share
```python
service.delete_share("my-share")
```
## Directory Operations
### Create Directory
```python
share_client = service.get_share_client("my-share")
share_client.create_directory("my-directory")
# Nested directory
share_client.create_directory("my-directory/sub-directory")
```
### List Directories and Files
```python
directory_client = share_client.get_directory_client("my-directory")
for item in directory_client.list_directories_and_files():
if item["is_directory"]:
print(f"[DIR] {item['name']}")
else:
print(f"[FILE] {item['name']} ({item['size']} bytes)")
```
### Delete Directory
```python
share_client.delete_directory("my-directory")
```
## File Operations
### Upload File
```python
file_client = share_client.get_file_client("my-directory/file.txt")
# From string
file_client.upload_file("Hello, World!")
# From file
with open("local-file.txt", "rb") as f:
file_client.upload_file(f)
# From bytes
file_client.upload_file(b"Binary content")
```
### Download File
```python
file_client = share_client.get_file_client("my-directory/file.txt")
# To bytes
data = file_client.download_file().readall()
# To file
with open("downloaded.txt", "wb") as f:
data = file_client.download_file()
data.readinto(f)
# Stream chunks
download = file_client.download_file()
for chunk in download.chunks():
process(chunk)
```
### Get File Properties
```python
properties = file_client.get_file_properties()
print(f"Size: {properties.size}")
print(f"Content type: {properties.content_settings.content_type}")
print(f"Last modified: {properties.last_modified}")
```
### Delete File
```python
file_client.delete_file()
```
### Copy File
```python
source_url = "https://account.file.core.windows.net/share/source.txt"
dest_client = share_client.get_file_client("destination.txt")
dest_client.start_copy_from_url(source_url)
```
## Range Operations
### Upload Range
```python
# Upload to specific range
file_client.upload_range(data=b"content", offset=0, length=7)
```
### Download Range
```python
# Download specific range
download = file_client.download_file(offset=0, length=100)
data = download.readall()
```
## Snapshot Operations
### Create Snapshot
```python
snapshot = share_client.create_snapshot()
print(f"Snapshot: {snapshot['snapshot']}")
```
### Access Snapshot
```python
snapshot_client = service.get_share_client(
"my-share",
snapshot=snapshot["snapshot"]
)
```
## Async Client
```python
from azure.storage.fileshare.aio import ShareServiceClient
from azure.identity.aio import DefaultAzureCredential
async def upload_file():
credential = DefaultAzureCredential()
service = ShareServiceClient(account_url, credential=credential)
share = service.get_share_client("my-share")
file_client = share.get_file_client("test.txt")
await file_client.upload_file("Hello!")
await service.close()
await credential.close()
```
## Client Types
| Client | Purpose |
|--------|---------|
| `ShareServiceClient` | Account-level operations |
| `ShareClient` | Share operations |
| `ShareDirectoryClient` | Directory operations |
| `ShareFileClient` | File operations |
## Best Practices
1. **Use connection string** for simplest setup
2. **Use Entra ID** for production with RBAC
3. **Stream large files** using chunks() to avoid memory issues
4. **Create snapshots** before major changes
5. **Set quotas** to prevent unexpected storage costs
6. **Use ranges** for partial file updates
7. **Close async clients** explicitly
## When to Use
This skill is applicable to execute the workflow or actions described in the overview.
## Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.Related Skills
figma-create-new-file
Create a new blank Figma file. Use when the user wants to create a new Figma design or FigJam file, or when you need a new file before calling use_figma. Handles plan resolution via whoami if needed. Usage — /figma-create-new-file [editorType] [fileName] (e.g. /figma-create-new-file figjam My Whiteboard)
skill-share
A skill that creates new Claude skills and automatically shares them on Slack using Rube for seamless team collaboration and skill discovery.
waiverfile-automation
Automate Waiverfile tasks via Rube MCP (Composio). Always search tools first for current schemas.
share_point-automation
Automate SharePoint tasks via Rube MCP (Composio): document libraries, sites, lists, and content management. Always search tools first for current schemas.
SharePoint Automation
SharePoint Automation: manage sites, lists, documents, folders, pages, and search content across SharePoint and OneDrive
files-com-automation
Automate Files Com tasks via Rube MCP (Composio). Always search tools first for current schemas.
ayrshare-automation
Automate Ayrshare tasks via Rube MCP (Composio). Always search tools first for current schemas.
dhdna-profiler
Extract cognitive patterns and thinking fingerprints from any text. Use this skill when the user wants to analyze how someone thinks, understand cognitive style, profile writing or speech patterns, compare thinking styles between people, asks "what's my thinking style", "analyze how this person reasons", "cognitive profile", "thinking pattern", "DHDNA", "digital DNA", or wants to understand the mind behind any text. Also trigger when the user provides text and wants deeper insight into the author's reasoning patterns, decision-making style, or cognitive signature.
planning-with-files
Work like Manus: Use persistent markdown files as your "working memory on disk."
microsoft-azure-webjobs-extensions-authentication-events-dotnet
Microsoft Entra Authentication Events SDK for .NET. Azure Functions triggers for custom authentication extensions.
linkedin-profile-optimizer
High-intent expert for LinkedIn profile checks, authority building, and SEO optimization. Invoke to audit, rewrite, and enhance profiles for top 1% positioning.
filesystem-context
Use for file-based context management, dynamic context discovery, and reducing context window bloat. Offload context to files for just-in-time loading.