Manages Azure Storage File Shares via Python SDK: create/list/delete shares and directories, upload/download files. Auth via connection string or Entra ID.
From antigravity-awesome-skillsnpx claudepluginhub sickn33/antigravity-awesome-skills --plugin antigravity-awesome-skillsThis skill uses the workspace's default tool permissions.
Designs and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
Manage SMB file shares for cloud-native and lift-and-shift scenarios.
pip install azure-storage-file-share
AZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...
# Or
AZURE_STORAGE_ACCOUNT_URL=https://<account>.file.core.windows.net
from azure.storage.fileshare import ShareServiceClient
service = ShareServiceClient.from_connection_string(
os.environ["AZURE_STORAGE_CONNECTION_STRING"]
)
from azure.storage.fileshare import ShareServiceClient
from azure.identity import DefaultAzureCredential
service = ShareServiceClient(
account_url=os.environ["AZURE_STORAGE_ACCOUNT_URL"],
credential=DefaultAzureCredential()
)
share = service.create_share("my-share")
for share in service.list_shares():
print(f"{share.name}: {share.quota} GB")
share_client = service.get_share_client("my-share")
service.delete_share("my-share")
share_client = service.get_share_client("my-share")
share_client.create_directory("my-directory")
# Nested directory
share_client.create_directory("my-directory/sub-directory")
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)")
share_client.delete_directory("my-directory")
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")
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)
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}")
file_client.delete_file()
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)
# Upload to specific range
file_client.upload_range(data=b"content", offset=0, length=7)
# Download specific range
download = file_client.download_file(offset=0, length=100)
data = download.readall()
snapshot = share_client.create_snapshot()
print(f"Snapshot: {snapshot['snapshot']}")
snapshot_client = service.get_share_client(
"my-share",
snapshot=snapshot["snapshot"]
)
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 | Purpose |
|---|---|
ShareServiceClient | Account-level operations |
ShareClient | Share operations |
ShareDirectoryClient | Directory operations |
ShareFileClient | File operations |
This skill is applicable to execute the workflow or actions described in the overview.