0
votes

Trying to run a powershell to change the DTUs for an Azure Elastic Pool. Problem is that it cannot find the resource group. Any ideas what is going wrong. My steps are:

  1. Sign in and run Azure Cloud shell
  2. Paste code below:
Set-AzureRmSqlElasticPool –ResourceGroupName "MyResourceGroup"–ServerName "MyServer.database.windows.net" –ElasticPoolName "My_ElasticPool" –Dtu 200 –DatabaseDtuMax 100 –DatabaseDtuMin 50

Full error is:

Set-AzureRmSqlElasticPool : The Resource 'Microsoft.Sql/servers/MyServer.database.windows.net/elasticpools/My_ElasticPool' underresource group 'MyResourceGroup' was not found. At line:1 char:1 + Set-AzureRmSqlElasticPool –ResourceGroupName "FluResourceGroup"–Serve ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Set-AzSqlElasticPool], CloudException + FullyQualifiedErrorId : Microsoft.Azure.Commands.Sql.ElasticPool.Cmdlet.SetAzureSqlElasticPool

Completely new to powershell so apologies if this is a donut question?

2
I would also suggest that you change from using the AzureRm to the Az module. AzureRm has been deprecated and all of the relevant functions have been ported to the Az module. docs.microsoft.com/en-us/powershell/azure/…Mike Oryszak

2 Answers

1
votes

the error clearly says: this resource doesnt exist under that resource group. I would assume that the resource group exists. this means that there is a typo in the resource name and\or resource was moved, etc.

Another option is the resource group doesnt exist at all and the error is misleading. I'd say in that case you need to select proper subscription with Select-AzSubscription %subscription_name%. Because Azure PowerShell operates under specific subscription context. It won't search across all subscriptions.

0
votes

Basic Error. Didn't reference the Azure server correctly. It should read:

Set-AzureRmSqlElasticPool –ResourceGroupName "MyResourceGroup"–ServerName "MyServer" –ElasticPoolName "My_ElasticPool" –Dtu 200 –DatabaseDtuMax 100 –DatabaseDtuMin 50