title: Publishing web deploy package to azure using Powershell
body: <p>I have the following powershell script to publish the same bits to webapps in different location.</p>
  
  <pre><code>Param(
  [String]$WebsiteBaseName="mywebsitename",
  [String]$WebDeployPackage="./test.zip",
  [String]$locations="eastus;westus"
  )
  Select-AzureRmProfile -Path ./rmprofile
  
  $locationArray = $locations -split ';'
  # Iterate and deploy the package
  for($i = 1; $i -le $locationArray.Length; $i++) {
      $WebsiteFullName = "'$WebsiteBaseName-$i'"
  
      Publish-AzureWebsiteProject -Package "$WebDeployPackage" -Name $WebsiteFullName
  }
  </code></pre>
  
  <p>But when running the script I'm getting the following error.</p>
  
  <pre><code>Publish-AzureWebsiteProject : Value cannot be null.
  Parameter name: path2
  </code></pre>
  
  <p>What am I doing wrong here? I'm using the same code I found in the documentation at <a href="https://msdn.microsoft.com/en-us/library/azure/dn722468.aspx" rel="nofollow">MSDN</a>.
  The example shows the same code.</p>
  
  <p>Thanks in advance</p>