Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
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.
The property is for NFS share only. The default is NoRootSquash.
properties.shareQuota
integer
The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python file_share_acls_patch.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""defmain():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.update(
resource_group_name="res3376",
account_name="sto328",
share_name="share6185",
file_share={
"properties": {
"signedIdentifiers": [
{
"accessPolicy": {
"expiryTime": "2021-05-01T08:49:37.0000000Z",
"permission": "rwd",
"startTime": "2021-04-01T08:49:37.0000000Z",
},
"id": "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI",
}
]
}
},
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/FileShareAclsPatch.jsonif __name__ == "__main__":
main()
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
*
* @summary Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/FileShareAclsPatch.json
*/asyncfunctionupdateShareAcls() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res3376";
const accountName = "sto328";
const shareName = "share6185";
const fileShare = {
signedIdentifiers: [
{
accessPolicy: {
expiryTime: newDate("2021-05-01T08:49:37.0000000Z"),
permission: "rwd",
startTime: newDate("2021-04-01T08:49:37.0000000Z"),
},
id: "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI",
},
],
};
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.update(
resourceGroupName,
accountName,
shareName,
fileShare,
);
console.log(result);
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/FileShareAclsPatch.json// this example is just showing the usage of "FileShares_Update" operation, for the dependent resources, they will have to be created separately.// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this FileShareResource created on azure// for more information of creating FileShareResource, please refer to the document of FileShareResourcestring subscriptionId = "{subscription-id}";
string resourceGroupName = "res3376";
string accountName = "sto328";
string shareName = "share6185";
ResourceIdentifier fileShareResourceId = FileShareResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, shareName);
FileShareResource fileShare = client.GetFileShareResource(fileShareResourceId);
// invoke the operation
FileShareData data = new FileShareData()
{
SignedIdentifiers =
{
new StorageSignedIdentifier()
{
Id = "MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI",
AccessPolicy = new StorageServiceAccessPolicy()
{
StartOn = DateTimeOffset.Parse("2021-04-01T08:49:37.0000000Z"),
ExpireOn = DateTimeOffset.Parse("2021-05-01T08:49:37.0000000Z"),
Permission = "rwd",
},
}
},
};
FileShareResource result = await fileShare.UpdateAsync(data);
// the variable result is a resource, you could call other operations on this instance as well// but just for demo, we get its data from this resource instance
FileShareData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
from azure.identity import DefaultAzureCredential
from azure.mgmt.storage import StorageManagementClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-storage
# USAGE
python file_shares_patch.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""defmain():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.update(
resource_group_name="res3376",
account_name="sto328",
share_name="share6185",
file_share={"properties": {"metadata": {"type": "image"}}},
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/FileSharesPatch.jsonif __name__ == "__main__":
main()
package armstorage_test
import (
"context""log""github.com/Azure/azure-sdk-for-go/sdk/azcore/to""github.com/Azure/azure-sdk-for-go/sdk/azidentity""github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/220ad9c6554fc7d6d10a89bdb441c1e3b36e3285/specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/FileSharesPatch.jsonfuncExampleFileSharesClient_Update_updateShares() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armstorage.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewFileSharesClient().Update(ctx, "res3376", "sto328", "share6185", armstorage.FileShare{
FileShareProperties: &armstorage.FileShareProperties{
Metadata: map[string]*string{
"type": to.Ptr("image"),
},
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.// res.FileShare = armstorage.FileShare{// Name: to.Ptr("share6185"),// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res3376/providers/Microsoft.Storage/storageAccounts/sto328/fileServices/default/shares/share6185"),// FileShareProperties: &armstorage.FileShareProperties{// Metadata: map[string]*string{// "type": to.Ptr("image"),// },// },// }
}
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
*
* @summary Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/FileSharesPatch.json
*/asyncfunctionupdateShares() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res3376";
const accountName = "sto328";
const shareName = "share6185";
const fileShare = { metadata: { type: "image" } };
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.update(
resourceGroupName,
accountName,
shareName,
fileShare,
);
console.log(result);
}
using Azure;
using Azure.ResourceManager;
using System;
using System.Threading.Tasks;
using Azure.Core;
using Azure.Identity;
using Azure.ResourceManager.Storage.Models;
using Azure.ResourceManager.Storage;
// Generated from example definition: specification/storage/resource-manager/Microsoft.Storage/stable/2023-05-01/examples/FileSharesPatch.json// this example is just showing the usage of "FileShares_Update" operation, for the dependent resources, they will have to be created separately.// get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line
TokenCredential cred = new DefaultAzureCredential();
// authenticate your client
ArmClient client = new ArmClient(cred);
// this example assumes you already have this FileShareResource created on azure// for more information of creating FileShareResource, please refer to the document of FileShareResourcestring subscriptionId = "{subscription-id}";
string resourceGroupName = "res3376";
string accountName = "sto328";
string shareName = "share6185";
ResourceIdentifier fileShareResourceId = FileShareResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName, shareName);
FileShareResource fileShare = client.GetFileShareResource(fileShareResourceId);
// invoke the operation
FileShareData data = new FileShareData()
{
Metadata =
{
["type"] = "image",
},
};
FileShareResource result = await fileShare.UpdateAsync(data);
// the variable result is a resource, you could call other operations on this instance as well// but just for demo, we get its data from this resource instance
FileShareData resourceData = result.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
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.
EnabledProtocols
Enumeration
The authentication protocol that is used for the file share. Can only be specified when creating a share.
Value
Description
NFS
SMB
FileShare
Object
Properties of the file share, including Id, resource name, resource type, Etag.
Name
Type
Description
etag
string
Resource Etag.
id
string
Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
The property is for NFS share only. The default is NoRootSquash.
properties.shareQuota
integer
The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.
properties.shareUsageBytes
integer
The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files.