Modifier

Partager via


New-AzWebAppAzureStoragePath

Creates an object that represents an Azure Storage path to be mounted in a Web App. It is meant to be used as a parameter (-AzureStoragePath) to Set-AzWebApp and Set-AzWebAppSlot

Syntax

New-AzWebAppAzureStoragePath
   -Name <String>
   -Type <AzureStorageType>
   -AccountName <String>
   -ShareName <String>
   -AccessKey <String>
   -MountPath <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

Creates an object that represent an Azure Storage path to be mounted inside a Web App.

Examples

Example 1

$storagePath1 = New-AzWebAppAzureStoragePath -Name "RemoteStorageAccount1" -AccountName "myaccount" -Type AzureFiles -ShareName "someShareName" -AccessKey "some access key" `
-MountPath "\mounts\myFolderInsideTheContainerWebApp"

$storagePath2 = New-AzWebAppAzureStoragePath -Name "RemoteStorageAccount2" -AccountName "myaccount2" -Type AzureFiles -ShareName "someShareName2" -AccessKey "some access key 2" `
-MountPath "\mounts\myFolderInsideTheContainerWebApp2"

Set-AzWebApp -ResourceGroupName myresourcegroup -Name myapp -AzureStoragePath $storagepath1, $storagePath2

Parameters

-AccessKey

Access key to the Azure Storage account

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-AccountName

Azure Storage account name. e.g.: myfilestorageaccount

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MountPath

Path in the container where the share specified by ShareName will be exposed. MountPath must be sub-directory of "\mounts".

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Name

The identifier of the Azure Storage property. Must be unique within the Web App or Slot

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ShareName

Name of the share to mount to the container

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Type

Type of Azure Storage account. Windows Containers only supports Azure Files

Type:AzureStorageType
Accepted values:AzureFiles, AzureBlob
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

None

Outputs

WebAppAzureStoragePath