Azure Files Reference
Azure Files provides fully managed cloud file shares that are accessible via the industry-standard Server Message Block (SMB) protocol and the Network File System (NFS) protocol. You can mount Azure file shares concurrently from all your cloud or on-premises deployments. Azure Files offers a scalable, secure, and reliable file storage solution for various applications and workloads.
Key Concepts
- File Share: A top-level container for files, similar to a folder in a traditional file system.
- Directory: A container within a file share to organize files.
- File: The actual data entity stored within a directory.
- SMB/NFS Protocol: Protocols used to access and manage file shares.
- Snapshots: Point-in-time copies of a file share.
Common Scenarios
- Lift-and-shift applications that share configuration or data files.
- Replacing or supplementing on-premises file servers.
- Providing shared storage for development and testing environments.
- Storing configuration files, diagnostic logs, or application data.
API Operations
File Share Operations
Create File Share
PUT //files/?restype=share
Creates a new file share in the specified storage account.
Parameters
Name | Type | Description |
restype | String | Required. Specifies that the operation is to create a file share. Value must be share . |
comp | String | Optional. Specifies the component of the resource to operate on. Value must be metadata to update share metadata. |
Success Response
Code | Description |
201 Created | File share created successfully. |
Get File Share Properties
GET //files/?restype=share
Retrieves properties for the specified file share.
Parameters
Name | Type | Description |
restype | String | Required. Specifies that the operation is to get file share properties. Value must be share . |
sharesnapshot | String | Optional. Specifies a snapshot of the file share to get properties for. |
Success Response
Code | Description |
200 OK | File share properties retrieved successfully. |
Delete File Share
DELETE //files/?restype=share
Deletes the specified file share.
Parameters
Name | Type | Description |
restype | String | Required. Specifies that the operation is to delete a file share. Value must be share . |
sharesnapshot | String | Optional. Specifies a snapshot of the file share to delete. |
Success Response
Code | Description |
202 Accepted | File share deleted successfully. |
File Operations
Create File
PUT //files///?comp=file
Creates a new file or replaces an existing file.
Parameters
Name | Type | Description |
comp | String | Required. Specifies the component of the resource to operate on. Value must be file . |
content-length | Integer | Required. The size of the file in bytes. |
The file content is provided in the request body.
Get File
GET //files///
Retrieves the properties and content of a file.
Success Response
Code | Description |
200 OK | File retrieved successfully. Content is in the response body. |
Delete File
DELETE //files///
Deletes the specified file.
Parameters
Name | Type | Description |
comp | String | Optional. Specifies the component of the resource to operate on. Value can be snapshot to delete a file snapshot. |
Success Response
Code | Description |
200 OK | File deleted successfully. |