Listet alle Freigaben auf.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares?api-version=2025-06-01
Mit optionalen Parametern:
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares?api-version=2025-06-01&$maxpagesize={$maxpagesize}&$filter={$filter}&$expand={$expand}
URI-Parameter
| Name |
In |
Erforderlich |
Typ |
Beschreibung |
|
accountName
|
path |
True
|
string
minLength: 3 maxLength: 24 pattern: ^[a-z0-9]+$
|
Der Name des Speicherkontos innerhalb der angegebenen Ressourcengruppe. Speicherkontonamen müssen zwischen 3 und 24 Zeichen lang sein und dürfen nur Zahlen und Kleinbuchstaben enthalten.
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Der Name der Ressourcengruppe. Bei dem Namen wird die Groß-/Kleinschreibung nicht beachtet.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
Die ID des Zielabonnements. Der Wert muss eine UUID sein.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Hierbei handelt es sich um die für diesen Vorgang zu verwendende API-Version.
|
|
$expand
|
query |
|
string
|
Optional, wird verwendet, um die Eigenschaften in den Eigenschaften der Freigabe zu erweitern. Gültige Werte sind: deleted, snapshots. Sollte als Zeichenfolge mit Trennzeichen ',' übergeben werden.
|
|
$filter
|
query |
|
string
|
Wahlfrei. Wenn angegeben, werden nur Freigabenamen aufgeführt, die mit dem Filter beginnen.
|
|
$maxpagesize
|
query |
|
string
|
Wahlfrei. Angegebene maximale Anzahl von Freigaben, die in die Liste aufgenommen werden können.
|
Antworten
| Name |
Typ |
Beschreibung |
|
200 OK
|
FileShareItems
|
Der Azure-Vorgang wurde erfolgreich abgeschlossen.
|
|
Other Status Codes
|
CloudError
|
Unerwartete Fehlerantwort.
|
Sicherheit
azure_auth
Azure Active Directory OAuth2-Fluss.
Typ:
oauth2
Ablauf:
implicit
Autorisierungs-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Bereiche
| Name |
Beschreibung |
|
user_impersonation
|
Identitätswechsel ihres Benutzerkontos
|
Beispiele
ListDeletedShares
Beispielanforderung
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2025-06-01&$expand=deleted
/**
* Samples for FileShares List.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/DeletedFileSharesList.json
*/
/**
* Sample code: ListDeletedShares.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listDeletedShares(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().list("res9290", "sto1590", null, null,
"deleted", 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 deleted_file_shares_list.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.list(
resource_group_name="res9290",
account_name="sto1590",
)
for item in response:
print(item)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/DeletedFileSharesList.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/DeletedFileSharesList.json
func ExampleFileSharesClient_NewListPager_listDeletedShares() {
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)
}
pager := clientFactory.NewFileSharesClient().NewListPager("res9290", "sto1590", &armstorage.FileSharesClientListOptions{Maxpagesize: nil,
Filter: nil,
Expand: to.Ptr("deleted"),
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.FileShareItems = armstorage.FileShareItems{
// Value: []*armstorage.FileShareItem{
// {
// Name: to.Ptr("share1644"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644_1234567890"),
// Etag: to.Ptr("\"0x8D589847D51C7DE\""),
// Properties: &armstorage.FileShareProperties{
// Deleted: to.Ptr(true),
// DeletedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-12-14T08:20:47.000Z"); return t}()),
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-14T08:20:47.000Z"); return t}()),
// RemainingRetentionDays: to.Ptr[int32](30),
// ShareQuota: to.Ptr[int32](1024),
// Version: to.Ptr("1234567890"),
// },
// },
// {
// Name: to.Ptr("share4052"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052"),
// Etag: to.Ptr("\"0x8D589847DAB5AF9\""),
// Properties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-14T08:20:47.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 Lists all shares.
*
* @summary Lists all shares.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/DeletedFileSharesList.json
*/
async function listDeletedShares() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9290";
const accountName = "sto1590";
const expand = "deleted";
const options = { expand };
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.fileShares.list(resourceGroupName, accountName, options)) {
resArray.push(item);
}
console.log(resArray);
}
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/DeletedFileSharesList.json
// this example is just showing the usage of "FileShares_List" 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 = "res9290";
string accountName = "sto1590";
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 and iterate over the result
string expand = "deleted";
await foreach (FileShareResource item in collection.GetAllAsync(expand: expand))
{
// the variable item 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 = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine("Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"value": [
{
"name": "share1644",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847D51C7DE\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644_1234567890",
"properties": {
"deleted": true,
"deletedTime": "2019-12-14T08:20:47Z",
"lastModifiedTime": "2019-05-14T08:20:47Z",
"remainingRetentionDays": 30,
"shareQuota": 1024,
"version": "1234567890"
}
},
{
"name": "share4052",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847DAB5AF9\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052",
"properties": {
"lastModifiedTime": "2019-05-14T08:20:47Z",
"shareQuota": 1024
}
}
]
}
ListShares
Beispielanforderung
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2025-06-01
/**
* Samples for FileShares List.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList.json
*/
/**
* Sample code: ListShares.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listShares(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().list("res9290", "sto1590", null, 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_list.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.list(
resource_group_name="res9290",
account_name="sto1590",
)
for item in response:
print(item)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList.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/FileSharesList.json
func ExampleFileSharesClient_NewListPager_listShares() {
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)
}
pager := clientFactory.NewFileSharesClient().NewListPager("res9290", "sto1590", &armstorage.FileSharesClientListOptions{Maxpagesize: nil,
Filter: nil,
Expand: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.FileShareItems = armstorage.FileShareItems{
// Value: []*armstorage.FileShareItem{
// {
// Name: to.Ptr("share1644"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644"),
// Etag: to.Ptr("\"0x8D589847D51C7DE\""),
// Properties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-14T08:20:47.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// },
// },
// {
// Name: to.Ptr("share4052"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052"),
// Etag: to.Ptr("\"0x8D589847DAB5AF9\""),
// Properties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-05-14T08:20:47.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 Lists all shares.
*
* @summary Lists all shares.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList.json
*/
async function listShares() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9290";
const accountName = "sto1590";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.fileShares.list(resourceGroupName, accountName)) {
resArray.push(item);
}
console.log(resArray);
}
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/FileSharesList.json
// this example is just showing the usage of "FileShares_List" 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 = "res9290";
string accountName = "sto1590";
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 and iterate over the result
await foreach (FileShareResource item in collection.GetAllAsync())
{
// the variable item 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 = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine("Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": "https://sto1590endpoint/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2022-09-01&$maxpagesize=2&$skipToken=/sto1590/share5103",
"value": [
{
"name": "share1644",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847D51C7DE\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644",
"properties": {
"lastModifiedTime": "2019-05-14T08:20:47Z",
"shareQuota": 1024
}
},
{
"name": "share4052",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847DAB5AF9\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052",
"properties": {
"lastModifiedTime": "2019-05-14T08:20:47Z",
"shareQuota": 1024
}
}
]
}
ListShareSnapshots
Beispielanforderung
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2025-06-01&$expand=snapshots
/**
* Samples for FileShares List.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileShareSnapshotsList.json
*/
/**
* Sample code: ListShareSnapshots.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listShareSnapshots(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().list("res9290", "sto1590", null, null,
"snapshots", 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_share_snapshots_list.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.list(
resource_group_name="res9290",
account_name="sto1590",
)
for item in response:
print(item)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileShareSnapshotsList.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/FileShareSnapshotsList.json
func ExampleFileSharesClient_NewListPager_listShareSnapshots() {
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)
}
pager := clientFactory.NewFileSharesClient().NewListPager("res9290", "sto1590", &armstorage.FileSharesClientListOptions{Maxpagesize: nil,
Filter: nil,
Expand: to.Ptr("snapshots"),
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.FileShareItems = armstorage.FileShareItems{
// Value: []*armstorage.FileShareItem{
// {
// Name: to.Ptr("share4052"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052"),
// Etag: to.Ptr("\"0x8D589847DAB5AF9\""),
// Properties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-26T05:47:05.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// },
// },
// {
// Name: to.Ptr("share4052"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052"),
// Etag: to.Ptr("\"0x8D589847DAB5AF9\""),
// Properties: &armstorage.FileShareProperties{
// LastModifiedTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-26T05:47:05.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// SnapshotTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-26T05:48:07.000Z"); return t}()),
// },
// }},
// }
}
}
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 Lists all shares.
*
* @summary Lists all shares.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileShareSnapshotsList.json
*/
async function listShareSnapshots() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9290";
const accountName = "sto1590";
const expand = "snapshots";
const options = { expand };
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.fileShares.list(resourceGroupName, accountName, options)) {
resArray.push(item);
}
console.log(resArray);
}
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/FileShareSnapshotsList.json
// this example is just showing the usage of "FileShares_List" 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 = "res9290";
string accountName = "sto1590";
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 and iterate over the result
string expand = "snapshots";
await foreach (FileShareResource item in collection.GetAllAsync(expand: expand))
{
// the variable item 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 = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine("Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"value": [
{
"name": "share4052",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847DAB5AF9\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052",
"properties": {
"lastModifiedTime": "2020-10-26T05:47:05.0000000Z",
"shareQuota": 1024
}
},
{
"name": "share4052",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847DAB5AF9\"",
"id": "/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052",
"properties": {
"lastModifiedTime": "2020-10-26T05:47:05.0000000Z",
"shareQuota": 1024,
"snapshotTime": "2020-10-26T05:48:07.0000000Z"
}
}
]
}
ListSharesPaidBursting
Beispielanforderung
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2025-06-01
/**
* Samples for FileShares List.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList_PaidBursting.
* json
*/
/**
* Sample code: ListSharesPaidBursting.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listSharesPaidBursting(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().list("res9290", "sto1590", null, 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_list_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.list(
resource_group_name="res9290",
account_name="sto1590",
)
for item in response:
print(item)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList_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/FileSharesList_PaidBursting.json
func ExampleFileSharesClient_NewListPager_listSharesPaidBursting() {
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)
}
pager := clientFactory.NewFileSharesClient().NewListPager("res9290", "sto1590", &armstorage.FileSharesClientListOptions{Maxpagesize: nil,
Filter: nil,
Expand: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.FileShareItems = armstorage.FileShareItems{
// Value: []*armstorage.FileShareItem{
// {
// Name: to.Ptr("share1644"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644"),
// Etag: to.Ptr("\"0x8D589847D51C7DE\""),
// Properties: &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-14T08:20:47.000Z"); return t}()),
// ShareQuota: to.Ptr[int32](1024),
// },
// },
// {
// Name: to.Ptr("share4052"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052"),
// Etag: to.Ptr("\"0x8D589847DAB5AF9\""),
// Properties: &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-14T08:20:47.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 Lists all shares.
*
* @summary Lists all shares.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList_PaidBursting.json
*/
async function listSharesPaidBursting() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9290";
const accountName = "sto1590";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.fileShares.list(resourceGroupName, accountName)) {
resArray.push(item);
}
console.log(resArray);
}
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/FileSharesList_PaidBursting.json
// this example is just showing the usage of "FileShares_List" 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 = "res9290";
string accountName = "sto1590";
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 and iterate over the result
await foreach (FileShareResource item in collection.GetAllAsync())
{
// the variable item 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 = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine("Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": "https://sto1590endpoint/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2022-09-01&$maxpagesize=2&$skipToken=/sto1590/share5103",
"value": [
{
"name": "share1644",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847D51C7DE\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644",
"properties": {
"fileSharePaidBursting": {
"paidBurstingEnabled": true,
"paidBurstingMaxBandwidthMibps": 10340,
"paidBurstingMaxIops": 102400
},
"lastModifiedTime": "2019-05-14T08:20:47Z",
"shareQuota": 1024
}
},
{
"name": "share4052",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847DAB5AF9\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052",
"properties": {
"fileSharePaidBursting": {
"paidBurstingEnabled": true,
"paidBurstingMaxBandwidthMibps": 10340,
"paidBurstingMaxIops": 102400
},
"lastModifiedTime": "2019-05-14T08:20:47Z",
"shareQuota": 1024
}
}
]
}
ListSharesProvisionedV2
Beispielanforderung
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2025-06-01
/**
* Samples for FileShares List.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList_ProvisionedV2.
* json
*/
/**
* Sample code: ListSharesProvisionedV2.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void listSharesProvisionedV2(com.azure.resourcemanager.AzureResourceManager azure) {
azure.storageAccounts().manager().serviceClient().getFileShares().list("res9290", "sto1590", null, 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_list_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.list(
resource_group_name="res9290",
account_name="sto1590",
)
for item in response:
print(item)
# x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList_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/FileSharesList_ProvisionedV2.json
func ExampleFileSharesClient_NewListPager_listSharesProvisionedV2() {
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)
}
pager := clientFactory.NewFileSharesClient().NewListPager("res9290", "sto1590", &armstorage.FileSharesClientListOptions{Maxpagesize: nil,
Filter: nil,
Expand: nil,
})
for pager.More() {
page, err := pager.NextPage(ctx)
if err != nil {
log.Fatalf("failed to advance page: %v", err)
}
for _, v := range page.Value {
// You could use page here. We use blank identifier for just demo purposes.
_ = v
}
// If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// page.FileShareItems = armstorage.FileShareItems{
// Value: []*armstorage.FileShareItem{
// {
// Name: to.Ptr("share1644"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644"),
// Etag: to.Ptr("\"0x8D589847D51C7DE\""),
// Properties: &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),
// },
// },
// {
// Name: to.Ptr("share4052"),
// Type: to.Ptr("Microsoft.Storage/storageAccounts/fileServices/shares"),
// ID: to.Ptr("/subscriptions/{subscription-id}/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052"),
// Etag: to.Ptr("\"0x8D589847DAB5AF9\""),
// Properties: &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 Lists all shares.
*
* @summary Lists all shares.
* x-ms-original-file: specification/storage/resource-manager/Microsoft.Storage/stable/2025-06-01/examples/FileSharesList_ProvisionedV2.json
*/
async function listSharesProvisionedV2() {
const subscriptionId = process.env["STORAGE_SUBSCRIPTION_ID"] || "{subscription-id}";
const resourceGroupName = process.env["STORAGE_RESOURCE_GROUP"] || "res9290";
const accountName = "sto1590";
const credential = new DefaultAzureCredential();
const client = new StorageManagementClient(credential, subscriptionId);
const resArray = new Array();
for await (const item of client.fileShares.list(resourceGroupName, accountName)) {
resArray.push(item);
}
console.log(resArray);
}
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/FileSharesList_ProvisionedV2.json
// this example is just showing the usage of "FileShares_List" 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 = "res9290";
string accountName = "sto1590";
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 and iterate over the result
await foreach (FileShareResource item in collection.GetAllAsync())
{
// the variable item 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 = item.Data;
// for demo we just print out the id
Console.WriteLine($"Succeeded on id: {resourceData.Id}");
}
Console.WriteLine("Succeeded");
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Beispiel für eine Antwort
{
"nextLink": "https://sto1590endpoint/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares?api-version=2022-09-01&$maxpagesize=2&$skipToken=/sto1590/share5103",
"value": [
{
"name": "share1644",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847D51C7DE\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share1644",
"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
}
},
{
"name": "share4052",
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"etag": "\"0x8D589847DAB5AF9\"",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/res9290/providers/Microsoft.Storage/storageAccounts/sto1590/fileServices/default/shares/share4052",
"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
}
}
]
}
Definitionen
| Name |
Beschreibung |
|
AccessPolicy
|
|
|
CloudError
|
Eine Fehlerantwort des Speicherdiensts.
|
|
CloudErrorBody
|
Eine Fehlerantwort des Speicherdiensts.
|
|
EnabledProtocols
|
Das Authentifizierungsprotokoll, das für die Dateifreigabe verwendet wird. Kann nur beim Erstellen einer Freigabe angegeben werden.
|
|
FileShareItem
|
Die Dateifreigabeeigenschaften werden aufgelistet.
|
|
FileShareItems
|
Antwortschema. Enthält eine Liste der zurückgegebenen Freigaben, und wenn paging angefordert oder erforderlich ist, eine URL zur nächsten Seite von Freigaben.
|
|
FileSharePropertiesFileSharePaidBursting
|
Eigenschaften für "Kostenpflichtige Platzierung" für Dateifreigaben.
|
|
LeaseDuration
|
Gibt an, ob die Lease für einen Container nur dann von unendlicher oder fester Dauer ist, wenn der Container geleast wird.
|
|
LeaseState
|
Leasestatus des Containers.
|
|
LeaseStatus
|
Der Lease-Status des Containers.
|
|
RootSquashType
|
Die Eigenschaft ist nur für NFS-Freigabe vorgesehen. Der Standardwert ist NoRootSquash.
|
|
ShareAccessTier
|
Zugriffsebene für bestimmte Freigaben. GpV2-Konto kann zwischen TransactionOptimized (Standard), Hot und Cool wählen. FileStorage-Konto kann Premium auswählen.
|
|
SignedIdentifier
|
|
AccessPolicy
Objekt
| Name |
Typ |
Beschreibung |
|
expiryTime
|
string
(date-time)
|
Ablaufzeit der Zugriffsrichtlinie
|
|
permission
|
string
|
Liste der abgekürzten Berechtigungen.
|
|
startTime
|
string
(date-time)
|
Startzeit der Zugriffsrichtlinie
|
CloudError
Objekt
Eine Fehlerantwort des Speicherdiensts.
| Name |
Typ |
Beschreibung |
|
error
|
CloudErrorBody
|
Eine Fehlerantwort des Speicherdiensts.
|
CloudErrorBody
Objekt
Eine Fehlerantwort des Speicherdiensts.
| Name |
Typ |
Beschreibung |
|
code
|
string
|
Ein Bezeichner für den Fehler. Codes sind unveränderlich und sollen programmgesteuert genutzt werden.
|
|
details
|
CloudErrorBody[]
|
Eine Liste mit zusätzlichen Details zum Fehler.
|
|
message
|
string
|
Eine Meldung, die den Fehler beschreibt, der für die Anzeige in einer Benutzeroberfläche geeignet ist.
|
|
target
|
string
|
Das Ziel des bestimmten Fehlers. Beispielsweise der Name der Eigenschaft im Fehler.
|
EnabledProtocols
Enumeration
Das Authentifizierungsprotokoll, das für die Dateifreigabe verwendet wird. Kann nur beim Erstellen einer Freigabe angegeben werden.
| Wert |
Beschreibung |
|
SMB
|
|
|
NFS
|
|
FileShareItem
Objekt
Die Dateifreigabeeigenschaften werden aufgelistet.
| Name |
Typ |
Beschreibung |
|
etag
|
string
|
Ressourcen-Etag.
|
|
id
|
string
|
Vollqualifizierte Ressourcen-ID für die Ressource. Zum Beispiel - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
|
|
name
|
string
|
Der Name der Ressource
|
|
properties.accessTier
|
ShareAccessTier
|
Zugriffsebene für bestimmte Freigaben. GpV2-Konto kann zwischen TransactionOptimized (Standard), Hot und Cool wählen. FileStorage-Konto kann Premium auswählen.
|
|
properties.accessTierChangeTime
|
string
(date-time)
|
Gibt den Zeitpunkt der letzten Änderung für die Freigabezugriffsebene an.
|
|
properties.accessTierStatus
|
string
|
Gibt an, ob ein Übergang für die Zugriffsebene aussteht.
|
|
properties.deleted
|
boolean
|
Gibt an, ob die Freigabe gelöscht wurde.
|
|
properties.deletedTime
|
string
(date-time)
|
Der Zeitpunkt des Löschens, wenn die Freigabe gelöscht wurde.
|
|
properties.enabledProtocols
|
EnabledProtocols
|
Das Authentifizierungsprotokoll, das für die Dateifreigabe verwendet wird. Kann nur beim Erstellen einer Freigabe angegeben werden.
|
|
properties.fileSharePaidBursting
|
FileSharePropertiesFileSharePaidBursting
|
Eigenschaften für "Kostenpflichtige Platzierung" für Dateifreigaben.
|
|
properties.includedBurstIops
|
integer
(int32)
|
Die berechneten Burst-IOPS der Freigabe. Diese Eigenschaft ist nur für Dateifreigaben vorgesehen, die unter dem Kontotyp "Files Provisioned v2" erstellt wurden.
|
|
properties.lastModifiedTime
|
string
(date-time)
|
Gibt das Datum und die Uhrzeit der letzten Änderung der Freigabe zurück.
|
|
properties.leaseDuration
|
LeaseDuration
|
Gibt an, ob die Lease für eine Freigabe nur dann von unendlicher oder fester Dauer ist, wenn die Freigabe geleast ist.
|
|
properties.leaseState
|
LeaseState
|
Leasingstatus der Aktie.
|
|
properties.leaseStatus
|
LeaseStatus
|
Der Leasingstatus der Aktie.
|
|
properties.maxBurstCreditsForIops
|
integer
(int64)
|
Die berechneten maximalen Burst-Gutschriften für die Freigabe. Diese Eigenschaft ist nur für Dateifreigaben vorgesehen, die unter dem Kontotyp "Files Provisioned v2" erstellt wurden.
|
|
properties.metadata
|
object
|
Ein Name-Wert-Paar, das der Freigabe als Metadaten zugeordnet werden soll.
|
|
properties.nextAllowedProvisionedBandwidthDowngradeTime
|
string
(date-time-rfc7231)
|
Gibt die nächste zulässige Zeit für das Downgrade der bereitgestellten Bandbreite für die Freigabe zurück. Diese Eigenschaft ist nur für Dateifreigaben vorgesehen, die unter dem Kontotyp "Files Provisioned v2" erstellt wurden.
|
|
properties.nextAllowedProvisionedIopsDowngradeTime
|
string
(date-time-rfc7231)
|
Gibt die nächste zulässige Zeit für das bereitgestellte IOPS-Downgrade für die Freigabe zurück. Diese Eigenschaft ist nur für Dateifreigaben vorgesehen, die unter dem Kontotyp "Files Provisioned v2" erstellt wurden.
|
|
properties.nextAllowedQuotaDowngradeTime
|
string
(date-time-rfc7231)
|
Gibt die nächste zulässige Zeit für das Downgrade der bereitgestellten Speichergröße für die Freigabe zurück. Diese Eigenschaft gilt nur für Dateifreigaben, die unter dem Kontotyp "Files Provisioned v1 SSD" und "Files Provisioned v2" erstellt wurden
|
|
properties.provisionedBandwidthMibps
|
integer
(int32)
|
Die bereitgestellte Bandbreite der Freigabe in mebibytes pro Sekunde. Diese Eigenschaft ist nur für Dateifreigaben vorgesehen, die unter dem Kontotyp "Files Provisioned v2" erstellt wurden. Bitte lesen Sie die GetFileServiceUsage-API-Antwort für den minimalen und maximal zulässigen Wert für die bereitgestellte Bandbreite.
|
|
properties.provisionedIops
|
integer
(int32)
|
Die bereitgestellten IOPS der Freigabe. Diese Eigenschaft ist nur für Dateifreigaben vorgesehen, die unter dem Kontotyp "Files Provisioned v2" erstellt wurden. Bitte lesen Sie die GetFileServiceUsage-API-Antwort für den minimalen und maximal zulässigen Wert für bereitgestellte IOPS.
|
|
properties.remainingRetentionDays
|
integer
(int32)
|
Verbleibende Aufbewahrungstage für Freigaben, die vorläufig gelöscht wurden.
|
|
properties.rootSquash
|
RootSquashType
|
Die Eigenschaft ist nur für NFS-Freigabe vorgesehen. Der Standardwert ist NoRootSquash.
|
|
properties.shareQuota
|
integer
(int32)
|
Die bereitgestellte Größe des Anteils in gibibytes. Muss größer als 0 und kleiner oder gleich 5 TB (5120) sein. Bei großen Dateifreigaben beträgt die maximale Größe 102400. Informationen zu Dateifreigaben, die unter dem Kontotyp "Files Provisioned v2" erstellt wurden, finden Sie in der GetFileServiceUsage-API-Antwort für die minimale und maximal zulässige bereitgestellte Speichergröße.
|
|
properties.shareUsageBytes
|
integer
(int64)
|
Die ungefähre Größe der Daten, die auf der Freigabe gespeichert sind. Beachten Sie, dass dieser Wert möglicherweise nicht alle kürzlich erstellten Dateien oder Dateien umfasst, deren Größe kürzlich geändert wurde.
|
|
properties.signedIdentifiers
|
SignedIdentifier[]
|
Liste der auf der Freigabe angegebenen gespeicherten Zugriffsrichtlinien.
|
|
properties.snapshotTime
|
string
(date-time)
|
Erstellungszeit des Freigabe-Snapshots, der in der Antwort von Listenfreigaben mit dem expand-Parameter "snapshots" zurückgegeben wird.
|
|
properties.version
|
string
|
Die Version der Freigabe.
|
|
type
|
string
|
Der Typ der Ressource. Z. B. "Microsoft.Compute/virtualMachines" oder "Microsoft.Storage/storageAccounts"
|
FileShareItems
Objekt
Antwortschema. Enthält eine Liste der zurückgegebenen Freigaben, und wenn paging angefordert oder erforderlich ist, eine URL zur nächsten Seite von Freigaben.
| Name |
Typ |
Beschreibung |
|
nextLink
|
string
(uri)
|
Der Link zur nächsten Seite von Elementen
|
|
value
|
FileShareItem[]
|
Die FileShareItem-Einträge auf dieser Seite
|
FileSharePropertiesFileSharePaidBursting
Objekt
Eigenschaften für "Kostenpflichtige Platzierung" für Dateifreigaben.
| Name |
Typ |
Beschreibung |
|
paidBurstingEnabled
|
boolean
|
Gibt an, ob kostenpflichtiges Bursting für die Freigabe aktiviert ist. Diese Eigenschaft gilt nur für Dateifreigaben, die unter dem Ssd-Kontotyp "Files Provisioned v1" erstellt wurden.
|
|
paidBurstingMaxBandwidthMibps
|
integer
(int32)
|
Die maximale bezahlte Platzbandbreite für den Anteil pro Sekunde in Mebibytes. Diese Eigenschaft gilt nur für Dateifreigaben, die unter dem Ssd-Kontotyp "Files Provisioned v1" erstellt wurden. Der maximal zulässige Wert ist 10340, was die maximale zulässige Bandbreite für eine Freigabe ist.
|
|
paidBurstingMaxIops
|
integer
(int32)
|
Die maximal bezahlten IOPS für die Aktie. Diese Eigenschaft gilt nur für Dateifreigaben, die unter dem Ssd-Kontotyp "Files Provisioned v1" erstellt wurden. Der maximal zulässige Wert ist 102400, was die maximal zulässigen IOPS für eine Freigabe ist.
|
LeaseDuration
Enumeration
Gibt an, ob die Lease für einen Container nur dann von unendlicher oder fester Dauer ist, wenn der Container geleast wird.
| Wert |
Beschreibung |
|
Infinite
|
|
|
Fixed
|
|
LeaseState
Enumeration
Leasestatus des Containers.
| Wert |
Beschreibung |
|
Available
|
|
|
Leased
|
|
|
Expired
|
|
|
Breaking
|
|
|
Broken
|
|
LeaseStatus
Enumeration
Der Lease-Status des Containers.
| Wert |
Beschreibung |
|
Locked
|
|
|
Unlocked
|
|
RootSquashType
Enumeration
Die Eigenschaft ist nur für NFS-Freigabe vorgesehen. Der Standardwert ist NoRootSquash.
| Wert |
Beschreibung |
|
NoRootSquash
|
|
|
RootSquash
|
|
|
AllSquash
|
|
ShareAccessTier
Enumeration
Zugriffsebene für bestimmte Freigaben. GpV2-Konto kann zwischen TransactionOptimized (Standard), Hot und Cool wählen. FileStorage-Konto kann Premium auswählen.
| Wert |
Beschreibung |
|
TransactionOptimized
|
|
|
Hot
|
|
|
Cool
|
|
|
Premium
|
|
SignedIdentifier
Objekt
| Name |
Typ |
Beschreibung |
|
accessPolicy
|
AccessPolicy
|
Zugriffsrichtlinie
|
|
id
|
string
|
Ein eindeutiger Bezeichner der gespeicherten Zugriffsrichtlinie.
|