title: Should I check with 'Get' before make changes to azure resources in powershell
body: <p>I need to add managed identity from script and I'm wondering if this is enought:</p>
  <pre><code>$webApp = Set-AzWebApp -AssignIdentity $true -Name $webappname -ResourceGroupName $resourceGroupName
  </code></pre>
  <p>Or should I add code to do like this:</p>
  <pre><code>$webApp = Get-AzWebApp -ResourceGroupName $resourceGroupName -Name $webappname
  
  if ($null -eq $webApp.Identity) {
      $webApp = Set-AzWebApp -AssignIdentity $true -Name $webappname -ResourceGroupName $resourceGroupName 
  }
  </code></pre>
  <p>What would be better? I'm wondering if <code>Get-AzWebApp</code> is smart enough to decide to not to run if there are no changes, or is it just 'deploy new version no matter what'</p>