title: Create/Update PATH MAPPINGS of Azure WebApp using Azure Devops task or PowerShell
body: <p>I want to update configure an Azure storage mount with <strong>Azure File Share</strong>(PATH MAPPINGS) for Azure WebApp on Containers via Azure DevOps pipeline. To achieve this, I am currently using an 'Azure PowerShell task' (code below). However, the PowerShell script is configuring the 'Advance' option, and exposes the Storage Account Access Key. Is there a way to configure the 'Basic' one.</p>
  <p>PowerShell 'New-AzWebAppAzureStoragePath' creates an 'advance' configuration.</p>
  <p>There is also a Devops task 'Azure webapp for containers' which allows me to set 'app settings' and 'configuration settings', but no option for 'path mappings'.</p>
  <p>Is there any alternative in PowerShell or Azure devops task, to create a 'path mapping' to Azure file share with 'BASIC' configuration.</p>
  <p><a href="https://i.stack.imgur.com/ivIAh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ivIAh.png" alt="enter image description here" /></a></p>
  <p>Script:</p>
  <pre><code>try{
  
      # Check if AzureStoragePath (PATH MAPPINGS) already exists for the web app
      $webapp = get-AzWebApp -ResourceGroupName $webAppResourceGroupName -Name $webAppName
      if($webapp.AzureStoragePath -ne $null){
          # 'Path Mapping' to Azure storage File does not exist. Proceed with creating one.
  
          # Get Storage Account Primary Key
          $storageAccountKey = (Get-AzStorageAccountKey -ResourceGroupName $storageResourceGroupName -AccountName $storageAccountName).value[0]
          $storageAccountContext = New-AzStorageContext -StorageAccountName $storageAccountName -StorageAccountKey $storageAccountKey
  
  
          # Returns 'True' or 'False' depending whether File share exists or not
          $storageShareObject = get-azstorageshare -Name $storageFileShareName -context $storageAccountContext -erroraction silentlycontinue
          $storageShareExists = (($storageShareObject) -ne $null)
  
          if($storageShareExists -ne 'True'){
              $storageShareObjectFQDN = $storageShareObject.name + &quot;.files.core.windows.net&quot;
              # Create a WebApp Storage Path object
              $webAppStoragePathObject = New-AzWebAppAzureStoragePath -Name 'someConfig' -AccountName $storageShareObjectFQDN -Type AzureFiles -ShareName $storageFileShareName -AccessKey $storageAccountKey -MountPath &quot;/edgemicro/config&quot; 
  
              # Configure the 'Path mappings' for the web app
              Set-AzWebApp -ResourceGroupName $webAppResourceGroupName -Name $webAppName -AzureStoragePath $webAppStoragePathObject
          }
      }
  
      
  
  
  }catch{
      # '$_' contains all the details about exception
      $_
  }
  </code></pre>