Sdílet prostřednictvím


File Shares - Restore

Restore a file share within a valid retention days if share soft delete is enabled

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore?api-version=2023-05-01

URI Parameters

Name In Required Type Description
accountName
path True

string

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

Regex pattern: ^[a-z0-9]+$

resourceGroupName
path True

string

The name of the resource group within the user's subscription. The name is case insensitive.

Regex pattern: ^[-\w\._\(\)]+$

shareName
path True

string

The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
deletedShareName True

string

Required. Identify the name of the deleted share that will be restored.

deletedShareVersion True

string

Required. Identify the version of the deleted share that will be restored.

Responses

Name Type Description
200 OK

OK -- The Share is successfully restored.

Other Status Codes

CloudError

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

RestoreShares

Sample request

POST https://management.azure.com/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/fileServices/default/shares/share1249/restore?api-version=2023-05-01

{
  "deletedShareName": "share1249",
  "deletedShareVersion": "1234567890"
}

Sample response

Definitions

Name Description
CloudError

An error response from the Storage service.

CloudErrorBody

An error response from the Storage service.

DeletedShare

The deleted share to be restored.

CloudError

An error response from the Storage service.

Name Type Description
error

CloudErrorBody

An error response from the Storage service.

CloudErrorBody

An error response from the Storage service.

Name Type Description
code

string

An identifier for the error. Codes are invariant and are intended to be consumed programmatically.

details

CloudErrorBody[]

A list of additional details about the error.

message

string

A message describing the error, intended to be suitable for display in a user interface.

target

string

The target of the particular error. For example, the name of the property in error.

DeletedShare

The deleted share to be restored.

Name Type Description
deletedShareName

string

Required. Identify the name of the deleted share that will be restored.

deletedShareVersion

string

Required. Identify the version of the deleted share that will be restored.