title: Other than Contributor, what Azure Role will allow the execution of Add-AzureRmAutoscaleSetting
body: <p>I have a Powershell script that is used to deploy an <em>Azure Cloud Service (Classic)</em>. Up until today, the app user was assigned a <code>Contributor</code> role. Part of tightening security, we are revoking this <code>Contributor</code> Role as it is too broad.</p>
  
  <p>Part of the deployment process is to update the AutoScaling settings of the production slot using <a href="https://docs.microsoft.com/en-us/powershell/module/azurerm.insights/add-azurermautoscalesetting" rel="nofollow noreferrer"><code>Add-AzureRmAutoscaleSetting</code></a>:</p>
  
  <pre><code>Add-AzureRmAutoscaleSetting -Location "East US" -Name $scalingName -ResourceGroupName $resourceGroup -TargetResourceId $targetResourceId -AutoscaleProfile $autoscaleProfile
  </code></pre>
  
  <p>As the Azure User is no longer assigned the role of <code>Contributor</code>, this command now fails saying it is "Forbidden":</p>
  
  <pre><code>Add-AzureRmAutoscaleSetting : Exception type: ErrorResponseException, Message: Null/Empty, Code: Null, Status code:Forbidden, Reason phrase: Forbidden
  At C:\Path\AzureRMTools.psm1:131 char:5
  +     Add-AzureRmAutoscaleSetting -Location "East US" -Name $scalingNam ...
  +     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  + CategoryInfo          : CloseError: (:) [Add-AzureRmAutoscaleSetting], PSInvalidOperationException
  + FullyQualifiedErrorId : Microsoft.Azure.Commands.Insights.Autoscale.AddAzureRmAutoscaleSettingCommand
  </code></pre>
  
  <p>I have tried assign the user many different Roles (Roles I think would have this permission) - but none of them seem to have permission to allow me to execute this. </p>
  
  <p>I would like to know which Role would contain this permission? If none, is it possible to crate a new Role that will allow the execution of the command. </p>
  
  <p>Thanks</p>