Obtiene las propiedades de un recurso compartido especificado.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}?api-version=2025-06-01
Con parámetros opcionales:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}?api-version=2025-06-01&$expand={$expand}
Parámetros de identificador URI
| Nombre |
En |
Requerido |
Tipo |
Description |
|
accountName
|
path |
True
|
string
minLength: 3 maxLength: 24 pattern: ^[a-z0-9]+$
|
Nombre de la cuenta de almacenamiento dentro del grupo de recursos especificado. Los nombres de cuentas de almacenamiento deben tener entre 3 y 24 caracteres, y usar solo números y letras minúsculas.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Nombre del grupo de recursos. El nombre distingue mayúsculas de minúsculas.
|
|
shareName
|
path |
True
|
string
minLength: 3 maxLength: 63
|
Nombre del recurso compartido de archivos dentro de la cuenta de almacenamiento especificada. Los nombres de los recursos compartidos de archivos deben tener entre 3 y 63 caracteres y usar solo números, minúsculas y guiones (-). Cada guión (-) debe ir inmediatamente precedido y seguido de una letra o número.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
Identificador de la suscripción de destino. El valor debe ser un UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
La versión de API que se va a utilizar para esta operación.
|
|
$expand
|
query |
|
string
|
Opcional, se usa para expandir las propiedades dentro de las propiedades del recurso compartido. Los valores válidos son: stats. Debe pasarse como una cadena con el delimitador ','.
|
| Nombre |
Requerido |
Tipo |
Description |
|
x-ms-snapshot
|
|
string
|
Opcional, se usa para recuperar propiedades de una instantánea.
|
Respuestas
| Nombre |
Tipo |
Description |
|
200 OK
|
FileShare
|
La operación de Azure se completó correctamente.
|
|
Other Status Codes
|
CloudError
|
Una respuesta de error inesperada.
|
Seguridad
azure_auth
Flujo de OAuth2 de Azure Active Directory.
Tipo:
oauth2
Flujo:
implicit
Dirección URL de autorización:
https://login.microsoftonline.com/common/oauth2/authorize
Ámbitos
| Nombre |
Description |
|
user_impersonation
|
suplantar la cuenta de usuario
|
Ejemplos
GetSharePaidBursting
Solicitud de ejemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2025-06-01
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_PaidBursting.
* json
*/
/**
* Sample code: GetSharePaidBursting.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getSharePaidBursting(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().getWithResponse("res9871", "sto6217",
"share1634", null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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_get_paid_bursting.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
"""
def main():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.get(
resource_group_name="res9871",
account_name="sto6217",
share_name="share1634",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_PaidBursting.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4e9df3afd38a1cfa00a5d49419dce51bd014601f/specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_PaidBursting.json
func ExampleFileSharesClient_Get_getSharePaidBursting() {
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().Get(ctx, "res9871", "sto6217", "share1634", &armstorage.FileSharesClientGetOptions{Expand: nil,
XMSSnapshot: 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("share1634"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634"),
// Etag: to.Ptr("\"0x8D592D74CC20EBA\""),
// FileShareProperties: &armstorage.FileShareProperties{
// FileSharePaidBursting: &armstorage.FileSharePropertiesFileSharePaidBursting{
// PaidBurstingEnabled: to.Ptr(true),
// PaidBurstingMaxBandwidthMibps: to.Ptr[int32](10340),
// PaidBurstingMaxIops: to.Ptr[int32](102400),
// },
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-26T05:06:14.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets properties of a specified share.
*
* @summary Gets properties of a specified share.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_PaidBursting.json
*/
async function getSharePaidBursting() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9871";
const accountName = "sto6217";
const shareName = "share1634";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.get(resourceGroupName, accountName, shareName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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/2025-06-01/examples/FileSharesGet_PaidBursting.json
// this example is just showing the usage of "FileShares_Get" 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 FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// 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}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Respuesta de muestra
{
"name": "share1634",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D592D74CC20EBA\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634",
"properties": {
"fileSharePaidBursting": {
"paidBurstingEnabled": true,
"paidBurstingMaxBandwidthMibps": 10340,
"paidBurstingMaxIops": 102400
},
"lastModifiedTime": "2019-05-26T05:06:14Z",
"shareQuota": 1024
}
}
GetShareProvisionedV2
Solicitud de ejemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2025-06-01
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_ProvisionedV2.
* json
*/
/**
* Sample code: GetShareProvisionedV2.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getShareProvisionedV2(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().getWithResponse("res9871", "sto6217",
"share1634", null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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_get_provisioned_v2.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
"""
def main():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.get(
resource_group_name="res9871",
account_name="sto6217",
share_name="share1634",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_ProvisionedV2.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4e9df3afd38a1cfa00a5d49419dce51bd014601f/specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_ProvisionedV2.json
func ExampleFileSharesClient_Get_getShareProvisionedV2() {
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().Get(ctx, "res9871", "sto6217", "share1634", &armstorage.FileSharesClientGetOptions{Expand: nil,
XMSSnapshot: 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("share1634"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634"),
// Etag: to.Ptr("\"0x8D592D74CC20EBA\""),
// FileShareProperties: &armstorage.FileShareProperties{
// IncludedBurstIops: to.Ptr[int32](15000),
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2024-10-25T01:50:50.000Z"); return t}()),
// MaxBurstCreditsForIops: to.Ptr[int64](36000000),
// NextAllowedProvisionedBandwidthDowngradeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "2024-10-25T01:48:09.000Z"); return t}()),
// NextAllowedProvisionedIopsDowngradeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "2024-10-25T01:48:09.000Z"); return t}()),
// NextAllowedQuotaDowngradeTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC1123, "2024-10-26T01:50:50.000Z"); return t}()),
// ProvisionedBandwidthMibps: to.Ptr[int32](200),
// ProvisionedIops: to.Ptr[int32](5000),
// ShareQuota: to.Ptr[int32](100),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets properties of a specified share.
*
* @summary Gets properties of a specified share.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_ProvisionedV2.json
*/
async function getShareProvisionedV2() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9871";
const accountName = "sto6217";
const shareName = "share1634";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.get(resourceGroupName, accountName, shareName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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/2025-06-01/examples/FileSharesGet_ProvisionedV2.json
// this example is just showing the usage of "FileShares_Get" 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 FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// 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}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Respuesta de muestra
{
"name": "share1634",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D592D74CC20EBA\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634",
"properties": {
"includedBurstIops": 15000,
"lastModifiedTime": "2024-10-25T01:50:50.0000000Z",
"maxBurstCreditsForIops": 36000000,
"nextAllowedProvisionedBandwidthDowngradeTime": "Fri, 25 Oct 2024 01:48:09 GMT",
"nextAllowedProvisionedIopsDowngradeTime": "Fri, 25 Oct 2024 01:48:09 GMT",
"nextAllowedQuotaDowngradeTime": "Sat, 26 Oct 2024 01:50:50 GMT",
"provisionedBandwidthMibps": 200,
"provisionedIops": 5000,
"shareQuota": 100
}
}
GetShares
Solicitud de ejemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2025-06-01
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet.json
*/
/**
* Sample code: GetShares.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getShares(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().getWithResponse("res9871", "sto6217",
"share1634", null, null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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_get.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
"""
def main():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.get(
resource_group_name="res9871",
account_name="sto6217",
share_name="share1634",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armstorage_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/storage/armstorage/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4e9df3afd38a1cfa00a5d49419dce51bd014601f/specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet.json
func ExampleFileSharesClient_Get_getShares() {
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().Get(ctx, "res9871", "sto6217", "share1634", &armstorage.FileSharesClientGetOptions{Expand: nil,
XMSSnapshot: 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("share1634"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634"),
// Etag: to.Ptr("\"0x8D592D74CC20EBA\""),
// FileShareProperties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-26T05:06:14.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets properties of a specified share.
*
* @summary Gets properties of a specified share.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet.json
*/
async function getShares() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9871";
const accountName = "sto6217";
const shareName = "share1634";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.get(resourceGroupName, accountName, shareName);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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/2025-06-01/examples/FileSharesGet.json
// this example is just showing the usage of "FileShares_Get" 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 FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// 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}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Respuesta de muestra
{
"name": "share1634",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D592D74CC20EBA\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634",
"properties": {
"lastModifiedTime": "2019-05-26T05:06:14Z",
"shareQuota": 1024
}
}
GetShareStats
Solicitud de ejemplo
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634?api-version=2025-06-01&$expand=stats
/**
* Samples for FileShares Get.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_Stats.json
*/
/**
* Sample code: GetShareStats.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getShareStats(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().getWithResponse("res9871", "sto6217",
"share1634", "stats", null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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_get_stats.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
"""
def main():
client = StorageManagementClient(
credential=DefaultAzureCredential(),
subscription_id="{subscription-id}",
)
response = client.file_shares.get(
resource_group_name="res9871",
account_name="sto6217",
share_name="share1634",
)
print(response)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_Stats.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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/v3"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/4e9df3afd38a1cfa00a5d49419dce51bd014601f/specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_Stats.json
func ExampleFileSharesClient_Get_getShareStats() {
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().Get(ctx, "res9871", "sto6217", "share1634", &armstorage.FileSharesClientGetOptions{Expand: to.Ptr("stats"),
XMSSnapshot: 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("share1634"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634"),
// Etag: to.Ptr("\"0x8D592D74CC20EBA\""),
// FileShareProperties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-26T05:06:14.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// ShareUsageBytes: to.Ptr[int64](652945),
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { StorageManagementClient } = require("@azure/arm-storage");
const { DefaultAzureCredential } = require("@azure/identity");
require("dotenv/config");
/**
* This sample demonstrates how to Gets properties of a specified share.
*
* @summary Gets properties of a specified share.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesGet_Stats.json
*/
async function getShareStats() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9871";
const accountName = "sto6217";
const shareName = "share1634";
const expand = "stats";
const options = { expand };
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const result = await client.fileShares.get(resourceGroupName, accountName, shareName, options);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
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/2025-06-01/examples/FileSharesGet_Stats.json
// this example is just showing the usage of "FileShares_Get" 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 FileServiceResource created on azure
// for more information of creating FileServiceResource, please refer to the document of FileServiceResource
string subscriptionId = "{subscription-id}";
string resourceGroupName = "res9871";
string accountName = "sto6217";
ResourceIdentifier fileServiceResourceId = FileServiceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, accountName);
FileServiceResource fileService = client.GetFileServiceResource(fileServiceResourceId);
// get the collection of this FileShareResource
FileShareCollection collection = fileService.GetFileShares();
// invoke the operation
string shareName = "share1634";
string expand = "stats";
NullableResponse<FileShareResource> response = await collection.GetIfExistsAsync(shareName, expand: expand);
FileShareResource result = response.HasValue ? response.Value : null;
if (result == null)
{
Console.WriteLine("Succeeded with null as result");
}
else
{
// 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}");
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Respuesta de muestra
{
"name": "share1634",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D592D74CC20EBA\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9871/providers/Microsoft.Storage/storageAccounts/sto6217/fileServices/default/shares/share1634",
"properties": {
"lastModifiedTime": "2019-05-26T05:06:14Z",
"shareQuota": 1024,
"shareUsageBytes": 652945
}
}
Definiciones
| Nombre |
Description |
|
AccessPolicy
|
|
|
CloudError
|
Respuesta de error del servicio Storage.
|
|
CloudErrorBody
|
Respuesta de error del servicio Storage.
|
|
EnabledProtocols
|
Protocolo de autenticación que se usa para el recurso compartido de archivos. Solo se puede especificar al crear un recurso compartido.
|
|
FileShare
|
Propiedades del recurso compartido de archivos, incluido Id, nombre de recurso, tipo de recurso, Etag.
|
|
FileSharePropertiesFileSharePaidBursting
|
Propiedades de expansión de pago del recurso compartido de archivos.
|
|
LeaseDuration
|
Especifica si la concesión de un contenedor es de duración infinita o fija, solo cuando se concede el contenedor.
|
|
LeaseState
|
Estado de concesión del contenedor.
|
|
LeaseStatus
|
El estado de concesión del contenedor.
|
|
RootSquashType
|
La propiedad es solo para el recurso compartido NFS. El valor predeterminado es NoRootSquash.
|
|
ShareAccessTier
|
Nivel de acceso para un recurso compartido específico. La cuenta de GpV2 puede elegir entre TransactionOptimized (valor predeterminado), Frecuente y Esporádico. La cuenta FileStorage puede elegir Premium.
|
|
SignedIdentifier
|
|
AccessPolicy
Objeto
| Nombre |
Tipo |
Description |
|
expiryTime
|
string
(date-time)
|
Hora de expiración de la directiva de acceso
|
|
permission
|
string
|
Lista de permisos abreviados.
|
|
startTime
|
string
(date-time)
|
Hora de inicio de la directiva de acceso
|
CloudError
Objeto
Respuesta de error del servicio Storage.
| Nombre |
Tipo |
Description |
|
error
|
CloudErrorBody
|
Respuesta de error del servicio Storage.
|
CloudErrorBody
Objeto
Respuesta de error del servicio Storage.
| Nombre |
Tipo |
Description |
|
code
|
string
|
Identificador del error. Los códigos son invariables y están diseñados para consumirse mediante programación.
|
|
details
|
CloudErrorBody[]
|
Lista de detalles adicionales sobre el error.
|
|
message
|
string
|
Mensaje que describe el error, diseñado para ser adecuado para mostrarse en una interfaz de usuario.
|
|
target
|
string
|
Destino del error concreto. Por ejemplo, el nombre de la propiedad en error.
|
EnabledProtocols
Enumeración
Protocolo de autenticación que se usa para el recurso compartido de archivos. Solo se puede especificar al crear un recurso compartido.
| Valor |
Description |
|
SMB
|
|
|
NFS
|
|
FileShare
Objeto
Propiedades del recurso compartido de archivos, incluido Id, nombre de recurso, tipo de recurso, Etag.
| Nombre |
Tipo |
Description |
|
etag
|
string
|
Etag de recursos.
|
|
id
|
string
|
Identificador de recurso completo para el recurso. Ej: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
name
|
string
|
Nombre del recurso
|
|
properties.accessTier
|
ShareAccessTier
|
Nivel de acceso para un recurso compartido específico. La cuenta de GpV2 puede elegir entre TransactionOptimized (valor predeterminado), Frecuente y Esporádico. La cuenta FileStorage puede elegir Premium.
|
|
properties.accessTierChangeTime
|
string
(date-time)
|
Indica la hora de la última modificación para el nivel de acceso compartido.
|
|
properties.accessTierStatus
|
string
|
Indica si hay una transición pendiente para el nivel de acceso.
|
|
properties.deleted
|
boolean
|
Indica si se eliminó el recurso compartido.
|
|
properties.deletedTime
|
string
(date-time)
|
La hora de eliminación si se eliminó el recurso compartido.
|
|
properties.enabledProtocols
|
EnabledProtocols
|
Protocolo de autenticación que se usa para el recurso compartido de archivos. Solo se puede especificar al crear un recurso compartido.
|
|
properties.fileSharePaidBursting
|
FileSharePropertiesFileSharePaidBursting
|
Propiedades de expansión de pago del recurso compartido de archivos.
|
|
properties.includedBurstIops
|
integer
(int32)
|
Las IOPS de ráfaga calculadas del recurso compartido. Esta propiedad solo es para los recursos compartidos de archivos creados en Tipo de cuenta aprovisionado v2 de Archivos.
|
|
properties.lastModifiedTime
|
string
(date-time)
|
Devuelve la fecha y la hora en que se modificó por última vez el recurso compartido.
|
|
properties.leaseDuration
|
LeaseDuration
|
Especifica si el arrendamiento de un recurso compartido es de duración infinita o fija, solo cuando se concede el recurso compartido.
|
|
properties.leaseState
|
LeaseState
|
Estado de arrendamiento de la acción.
|
|
properties.leaseStatus
|
LeaseStatus
|
El estado de arrendamiento de la acción.
|
|
properties.maxBurstCreditsForIops
|
integer
(int64)
|
Los créditos de ráfaga máximos calculados para el recurso compartido. Esta propiedad solo es para los recursos compartidos de archivos creados en Tipo de cuenta aprovisionado v2 de Archivos.
|
|
properties.metadata
|
object
|
Par nombre-valor que se va a asociar al recurso compartido como metadatos.
|
|
properties.nextAllowedProvisionedBandwidthDowngradeTime
|
string
(date-time-rfc7231)
|
Devuelve el siguiente tiempo de degradación de ancho de banda aprovisionado permitido para el recurso compartido. Esta propiedad solo es para los recursos compartidos de archivos creados en Tipo de cuenta aprovisionado v2 de Archivos.
|
|
properties.nextAllowedProvisionedIopsDowngradeTime
|
string
(date-time-rfc7231)
|
Devuelve el siguiente tiempo de degradación de IOPS aprovisionadas permitido para el recurso compartido. Esta propiedad solo es para los recursos compartidos de archivos creados en Tipo de cuenta aprovisionado v2 de Archivos.
|
|
properties.nextAllowedQuotaDowngradeTime
|
string
(date-time-rfc7231)
|
Devuelve el siguiente tiempo de degradación del tamaño de almacenamiento aprovisionado permitido para el recurso compartido. Esta propiedad solo es para recursos compartidos de archivos creados en el tipo de cuenta SSD Files Provisioned v1 y Files Provisioned v2
|
|
properties.provisionedBandwidthMibps
|
integer
(int32)
|
Ancho de banda aprovisionado del recurso compartido, en mebibytes por segundo. Esta propiedad solo es para los recursos compartidos de archivos creados en Tipo de cuenta aprovisionado v2 de Archivos. Consulte la respuesta de la API GetFileServiceUsage para obtener el valor mínimo y máximo permitido para el ancho de banda aprovisionado.
|
|
properties.provisionedIops
|
integer
(int32)
|
IOPS aprovisionadas del recurso compartido. Esta propiedad solo es para los recursos compartidos de archivos creados en Tipo de cuenta aprovisionado v2 de Archivos. Consulte la respuesta de la API GetFileServiceUsage para obtener el valor mínimo y máximo permitido para IOPS aprovisionadas.
|
|
properties.remainingRetentionDays
|
integer
(int32)
|
Días de retención restantes para el recurso compartido que se eliminó temporalmente.
|
|
properties.rootSquash
|
RootSquashType
|
La propiedad es solo para el recurso compartido NFS. El valor predeterminado es NoRootSquash.
|
|
properties.shareQuota
|
integer
(int32)
|
Tamaño aprovisionado del recurso compartido, en gibibytes. Debe ser mayor que 0 y menor o igual que 5 TB (5120). Para recursos compartidos de archivos grandes, el tamaño máximo es 102400. En el caso de los recursos compartidos de archivos creados en Tipo de cuenta de Files Provisioned v2, consulte la respuesta de la API GetFileServiceUsage para obtener el tamaño de almacenamiento aprovisionado mínimo y máximo permitido.
|
|
properties.shareUsageBytes
|
integer
(int64)
|
El tamaño aproximado de los datos almacenados en el recurso compartido. Tenga en cuenta que es posible que este valor no incluya todos los archivos creados recientemente o cuyo tamaño se ha cambiado recientemente.
|
|
properties.signedIdentifiers
|
SignedIdentifier[]
|
Lista de directivas de acceso almacenadas especificadas en el recurso compartido.
|
|
properties.snapshotTime
|
string
(date-time)
|
Hora de creación de la instantánea del recurso compartido devuelta en la respuesta de los recursos compartidos de lista con "instantáneas" de parámetros de expansión.
|
|
properties.version
|
string
|
La versión del recurso compartido.
|
|
type
|
string
|
Tipo de recurso. Por ejemplo, "Microsoft.Compute/virtualMachines" o "Microsoft.Storage/storageAccounts"
|
FileSharePropertiesFileSharePaidBursting
Objeto
Propiedades de expansión de pago del recurso compartido de archivos.
| Nombre |
Tipo |
Description |
|
paidBurstingEnabled
|
boolean
|
Indica si la expansión de pago está habilitada para el recurso compartido. Esta propiedad solo es para los recursos compartidos de archivos creados en tipo de cuenta SSD aprovisionada v1 de Files.
|
|
paidBurstingMaxBandwidthMibps
|
integer
(int32)
|
Ancho de banda máximo de expansión de pago para el recurso compartido, en mebibytes por segundo. Esta propiedad solo es para los recursos compartidos de archivos creados en tipo de cuenta SSD aprovisionada v1 de Files. El valor máximo permitido es 10340, que es el ancho de banda máximo permitido para un recurso compartido.
|
|
paidBurstingMaxIops
|
integer
(int32)
|
Número máximo de IOPS de expansión de pago para el recurso compartido. Esta propiedad solo es para los recursos compartidos de archivos creados en tipo de cuenta SSD aprovisionada v1 de Files. El valor máximo permitido es 102400, que es el valor máximo permitido de IOPS para un recurso compartido.
|
LeaseDuration
Enumeración
Especifica si la concesión de un contenedor es de duración infinita o fija, solo cuando se concede el contenedor.
| Valor |
Description |
|
Infinite
|
|
|
Fixed
|
|
LeaseState
Enumeración
Estado de concesión del contenedor.
| Valor |
Description |
|
Available
|
|
|
Leased
|
|
|
Expired
|
|
|
Breaking
|
|
|
Broken
|
|
LeaseStatus
Enumeración
El estado de concesión del contenedor.
| Valor |
Description |
|
Locked
|
|
|
Unlocked
|
|
RootSquashType
Enumeración
La propiedad es solo para el recurso compartido NFS. El valor predeterminado es NoRootSquash.
| Valor |
Description |
|
NoRootSquash
|
|
|
RootSquash
|
|
|
AllSquash
|
|
ShareAccessTier
Enumeración
Nivel de acceso para un recurso compartido específico. La cuenta de GpV2 puede elegir entre TransactionOptimized (valor predeterminado), Frecuente y Esporádico. La cuenta FileStorage puede elegir Premium.
| Valor |
Description |
|
TransactionOptimized
|
|
|
Hot
|
|
|
Cool
|
|
|
Premium
|
|
SignedIdentifier
Objeto
| Nombre |
Tipo |
Description |
|
accessPolicy
|
AccessPolicy
|
Directiva de acceso
|
|
id
|
string
|
Identificador único de la directiva de acceso almacenada.
|