# AzureStorageExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Azure.Storage](/reference/api/csharp/aspire.hosting.azure.storage.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs)

Extension methods for adding Azure Storage resources to an application model.

## Definition

```csharp
namespace Aspire.Hosting;

public static class AzureStorageExtensions
{
    // ...
}
```

## Methods

- [AddAzureStorage(IDistributedApplicationBuilder, string)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#addazurestorage-idistributedapplicationbuilder-string) : `IResourceBuilder<AzureStorageResource>` `extension` `ats export` -- Adds an Azure Storage resource to the application model. This resource can be used to create Azure blob, table, and queue resources.
- [AddBlobContainer(IResourceBuilder<AzureStorageResource>, string, string?)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#addblobcontainer-iresourcebuilder-azurestorageresource-string-string) : `IResourceBuilder<AzureBlobStorageContainerResource>` `extension` `ats export` -- Creates a builder for the [AzureBlobStorageContainerResource](/reference/api/csharp/aspire.hosting.azure.storage/azureblobstoragecontainerresource.md) which can be referenced to get the Azure Storage blob container endpoint for the storage account.
- [AddBlobContainer(IResourceBuilder<AzureBlobStorageResource>, string, string?)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#addblobcontainer-iresourcebuilder-azureblobstorageresource-string-string) : `IResourceBuilder<AzureBlobStorageContainerResource>` `extension` `obsolete` -- Creates a builder for the [AzureBlobStorageContainerResource](/reference/api/csharp/aspire.hosting.azure.storage/azureblobstoragecontainerresource.md) which can be referenced to get the Azure Storage blob container endpoint for the storage account.
- [AddBlobs(IResourceBuilder<AzureStorageResource>, string)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#addblobs-iresourcebuilder-azurestorageresource-string) : `IResourceBuilder<AzureBlobStorageResource>` `extension` `ats export` -- Creates a builder for the [AzureBlobStorageResource](/reference/api/csharp/aspire.hosting.azure.storage/azureblobstorageresource.md) which can be referenced to get the Azure Storage blob endpoint for the storage account.
- [AddDataLake(IResourceBuilder<AzureStorageResource>, string)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#adddatalake-iresourcebuilder-azurestorageresource-string) : `IResourceBuilder<AzureDataLakeStorageResource>` `extension` `ats export` -- Creates a builder for the [AzureDataLakeStorageResource](/reference/api/csharp/aspire.hosting.azure.storage/azuredatalakestorageresource.md) which can be referenced to get the Azure Data Lake endpoint for the storage account.
- [AddDataLakeFileSystem(IResourceBuilder<AzureStorageResource>, string, string?)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#adddatalakefilesystem-iresourcebuilder-azurestorageresource-string-string) : `IResourceBuilder<AzureDataLakeStorageFileSystemResource>` `extension` `ats export` -- Creates a builder for the [AzureDataLakeStorageFileSystemResource](/reference/api/csharp/aspire.hosting.azure.storage/azuredatalakestoragefilesystemresource.md) which can be referenced to get the Azure DataLake file system connection string.
- [AddQueue(IResourceBuilder<AzureStorageResource>, string, string?)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#addqueue-iresourcebuilder-azurestorageresource-string-string) : `IResourceBuilder<AzureQueueStorageQueueResource>` `extension` `ats export` -- Creates a builder for the [AzureQueueStorageQueueResource](/reference/api/csharp/aspire.hosting.azure.storage/azurequeuestoragequeueresource.md) which can be referenced to get the Azure Storage queue for the storage account.
- [AddQueues(IResourceBuilder<AzureStorageResource>, string)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#addqueues-iresourcebuilder-azurestorageresource-string) : `IResourceBuilder<AzureQueueStorageResource>` `extension` `ats export` -- Creates a builder for the [AzureQueueStorageResource](/reference/api/csharp/aspire.hosting.azure.storage/azurequeuestorageresource.md) which can be referenced to get the Azure Storage queues endpoint for the storage account.
- [AddTables(IResourceBuilder<AzureStorageResource>, string)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#addtables-iresourcebuilder-azurestorageresource-string) : `IResourceBuilder<AzureTableStorageResource>` `extension` `ats export` -- Creates a builder for the [AzureTableStorageResource](/reference/api/csharp/aspire.hosting.azure.storage/azuretablestorageresource.md) which can be referenced to get the Azure Storage tables endpoint for the storage account.
- [RunAsEmulator(IResourceBuilder<AzureStorageResource>, Action<IResourceBuilder<AzureStorageEmulatorResource>>)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#runasemulator-iresourcebuilder-azurestorageresource-action-iresourcebuilder-azurestorageemulatorresource) : `IResourceBuilder<AzureStorageResource>` `extension` `ats export` -- Configures an Azure Storage resource to be emulated using Azurite. This resource requires an [AzureStorageResource](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageresource.md) to be added to the application model.
- [WithApiVersionCheck(IResourceBuilder<AzureStorageEmulatorResource>, bool)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#withapiversioncheck-iresourcebuilder-azurestorageemulatorresource-bool) : `IResourceBuilder<AzureStorageEmulatorResource>` `extension` `ats export` -- Ensures the emulator checks that the requested API version is valid.
- [WithBlobPort(IResourceBuilder<AzureStorageEmulatorResource>, int)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#withblobport-iresourcebuilder-azurestorageemulatorresource-int) : `IResourceBuilder<AzureStorageEmulatorResource>` `extension` `ats export` -- Modifies the host port that the storage emulator listens on for blob requests.
- [WithDataBindMount(IResourceBuilder<AzureStorageEmulatorResource>, string?, bool)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#withdatabindmount-iresourcebuilder-azurestorageemulatorresource-string-bool) : `IResourceBuilder<AzureStorageEmulatorResource>` `extension` `ats export` -- Adds a bind mount for the data folder to an Azure Storage emulator resource.
- [WithDataVolume(IResourceBuilder<AzureStorageEmulatorResource>, string?, bool)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#withdatavolume-iresourcebuilder-azurestorageemulatorresource-string-bool) : `IResourceBuilder<AzureStorageEmulatorResource>` `extension` `ats export` -- Adds a named volume for the data folder to an Azure Storage emulator resource.
- [WithQueuePort(IResourceBuilder<AzureStorageEmulatorResource>, int)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#withqueueport-iresourcebuilder-azurestorageemulatorresource-int) : `IResourceBuilder<AzureStorageEmulatorResource>` `extension` `ats export` -- Modifies the host port that the storage emulator listens on for queue requests.
- [WithRoleAssignments(IResourceBuilder<T>, IResourceBuilder<AzureStorageResource>, StorageBuiltInRole[])](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#withroleassignments-iresourcebuilder-t-iresourcebuilder-azurestorageresource-storagebuiltinrole) : `IResourceBuilder<T>` `extension` `ats ignored` -- Assigns the specified roles to the given resource, granting it the necessary permissions on the target Azure Storage account. This replaces the default role assignments for the resource.
- [WithTablePort(IResourceBuilder<AzureStorageEmulatorResource>, int)](/reference/api/csharp/aspire.hosting.azure.storage/azurestorageextensions/methods.md#withtableport-iresourcebuilder-azurestorageemulatorresource-int) : `IResourceBuilder<AzureStorageEmulatorResource>` `extension` `ats export` -- Modifies the host port that the storage emulator listens on for table requests.
