Azure-docs: Error

Created on 10 Nov 2018  Â·  17Comments  Â·  Source: MicrosoftDocs/azure-docs

Get-AzureRmSqlDatabaseGeoBackup -ResourceGroupName $resourcegroupname -ServerName $servername

always results in (even after a longer period of time):

Get-AzureRmSqlDatabaseGeoBackup : 40647: Subscription '------' does not have the server '---------'

Get-AzureRmSqlDatabaseRestorePoints -ResourceGroupName $resourcegroupname -ServerName $servername -DatabaseName $databasename

succeds, so data in variables is correct...


Detalji dokumenta

⚠ Ne uređujte ovu sekciju. Ona je neophodna za povezivanje problema slijedom docs.microsoft.com ➟ GitHub.

Pri2 assigned-to-author doc-enhancement sql-databassvc triaged

All 17 comments

@mcurko Thanks for the feedback! We are currently investigating and will update you shortly.

@mcurko Do you have GeoReplication set-up for the server being referenced with this cmdlet or are you attempting to use this cmdlet against Azure SQL Data Warehouse?

Get-AzureRmSqlDatabaseGeoBackup

The Get-AzureRMSqlDatabaseGeoBackup cmdlet gets a specified geo-redundant backup of a SQL database or all available geo-redundant backups on a specified server. A geo-redundant backup is a restorable resource using data files from a separate geographic location. You can use Geo-Restore to restore a geo-redundant backup in the event of a regional outage to recover your database to a new region. This cmdlet is also supported by the SQL Server Stretch Database service on Azure.

Get-AzureRmSqlDatabaseRestorePoints

The Get-AzureRmSqlDatabaseRestorePoints cmdlet retrieves the distinct restore points that an _Azure SQL Data Warehouse_ can be restored from. For an Azure SQL Database, the restore window is continuous. This means that any point in time in the backup retention period of the database can be used as a restore point. This cmdlet is also supported by the SQL Server Stretch Database service on Azure.

Each cmdlet is slightly different, as I have included the description of each for clarity. Thanks,
Mike

If I understand correctly, geo-redundand backups are created whether the Azure SQL Database is geo-replicated or not. However, yes I did test the code with a geo-redundant Azure SQL Database – I made 3 complete and separate attempts, the problem is always the same.

Pozdrav,
Marko ÄŒurko

@mcurko Yes, the Get-AzureRmSqlDatabaseGeoBackup cmdlet will work for single instance as well as geo-redundant instances. I was able to successfully run both cmdlets in the Azure Cloud Shell and a local instance of PowerShell.

Can you run the following 2 commands in your PowerShell environment:

get-host
get-package AzureRM.Sql

From an environment where the cmdlets run successfully:

PS C:\Users\miubezzi> get-package AzureRM.Sql
AzureRM.Sql 4.8.1-preview

PS C:\Users\miubezzi> get-host
Name : ConsoleHost
Version : 5.1.17134.228
InstanceId : 14b9973c-748d-450f-aab1-b7dba8fae9f6
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

This is what I see (I have a newer version of the module, maybe that's the problem):

PS C:\Users\mcurko> get-host

Name : ConsoleHost
Version : 5.1.16299.492
InstanceId : b573d789-9c82-43b7-81f4-d46adba808ea
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : hr-HR
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace

PS C:\Users\mcurko> get-package AzureRM.Sql

Name Version Source ProviderName
---- ------- ------ ------------
AzureRM.Sql 4.11.5 https://www.powershellgallery... PowerShellGet

Regards,
Marko ÄŒurko

@mcurko Please use the following documentation to roll-back to a previous version of AzureRM.Sql.

You can run something like the following:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

PS C:\WINDOWS\system32> write-host "$PSModulePath"

PS C:\WINDOWS\system32> Get-Module -ListAvailable

Which will generate a nice list of available modules to install but here are the AzureRM.Sql modules:

Script 4.8.1 AzureRM.Sql {Get-AzureRmSqlDatabaseTransparentDataEncryption, Get-Azur...
Script 4.5.0 AzureRM.Sql {Get-AzureRmSqlDatabaseTransparentDataEncryption, Get-Azur...
Script 4.4.0 AzureRM.Sql {Get-AzureRmSqlDatabaseTransparentDataEncryption, Get-Azur...

Shouldn't the tutorial be updated to support newest versions of modules, rather than suggesting to roll them back?

Regards,
Marko ÄŒurko

@mcurko The documentation could at least indicate which module versions the tutorial is based upon or is required to complete successfully. I have assigned the issue to the content author to evaluate and update as appropriate.

@mcurko I agree that this tutorial should always run on the newest versions of PowerShell. I am investigating whether this is a regression to be fixed or by design.
@anosov1960 your input is requested

@Mike-Ubezzi-MSFT please assign to @anosov1960

@MashaMSFT please work with @anosov1960 to respond to this git issue

Hi @mcurko , thanks for contacting Microsoft! Just wanted to give up an update and let you know that we're updating the PowerShell docs, with this article on our list as well. This work should be done soon, and I'll update here once it's complete. Thanks for your patience!

@Mike-Ubezzi-MSFT please assign to @MashaMSFT

Hi @mcurko , thanks for bringing this to our attention! The script has been updated and should work now. Can you please try it out? Thanks!

Hi @mcurko , it's been some time so we'll have to assume the tutorial is resolved and close out this Git Issue. However, please feel free to comment should you need anything further, and thanks again for notifying us of this! #please-close

We will now proceed to close this thread. If there are further questions regarding this matter, please comment and we will gladly continue the discussion.

I am still seeing this issue.

Get-AzureRmSqlDatabaseGeoBackup -ResourceGroupName -ServerName -Confirm -DatabaseName

Get-AzureRmSqlDatabaseGeoBackup : 40647: Subscription 'subscription-id' does not have the server
'server-name'.

I ran> get-package AzureRM.Sql
Name Version Source ProviderName
---- ------- ------ ------------
AzureRM.Sql 4.12.1 https://www.powershellgallery... PowerShellGet

Ran it on both Windows Power Shell (with AzureRM.sql module) and Azure Cloud Shell (with AzureRM.sql). Didn't work, same message.

I tried with server name & server name (fully qualified)

Also, did use this to explicitly set the subscription-id.
Set-AzureRmContext -SubscriptionId 'subscription-id'

Get-AzureRmResource also returned the server name with specific subscription id.

Further, I switched over to az, same experience but
Get-AzSqlDatabaseGeoBackupPolicy -ResourceGroupName -ServerName -DatabaseName
returned
Location : East US
ResourceGroupName :
ServerName :
DatabaseName :
State : Enabled

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Agazoth picture Agazoth  Â·  3Comments

Favna picture Favna  Â·  3Comments

AronT-TLV picture AronT-TLV  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

behnam89 picture behnam89  Â·  3Comments