azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzSqlDatabase where do I find the PausedDate Like in the CLI command az sql db list

Open lostsole opened this issue 2 years ago • 3 comments

Description

##NOTE: Missing PuasedDate $AzSQLServer=(Get-AzSqlServer); $AzSQLDatabases=($AzSQLServer|Get-AzSqlDatabase);

I can see the status that the database is paused but can not find the date in Get-AzSqlDatabase output

CLI: has the PuasedDate! $query = '[].{ResourceGroup:resourceGroup, Location:location, DBName:name , SKUCapacity:sku.capacity , SKUName:sku.name , SKUSize:sku.size , SKUTier:sku.tier , Status:status, Type:type , PausedDate:pausedDate}' $Results = (az sql db list --ids $(az sql server list --query [].id --output tsv) --query $query --output json | convertfrom-json)

Script or Debug output

No error

Environment data

Name                           Value
----                           -----
PSVersion                      7.2.6
PSEdition                      Core
GitCommitId                    7.2.6
OS                             Microsoft Windows 10.0.19044
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3    
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

PS C:\Program Files\7-Zip> Get-Module Az*

ModuleType Version    Name                    
---------- -------    ----                    
Script     2.9.1      Az.Accounts             
Script     4.6.1      Az.KeyVault             
Script     3.0.1      Az.Monitor              
Script     0.1.0      Az.MonitoringSolutions  
Script     3.1.0      Az.OperationalInsights  
Script     6.1.0      Az.Resources            
Script     3.11.0     Az.Sql                  
Script     4.8.0      Az.Storage              
Script     1.5.0      Az.Synapse

Error output

No error just trying to locate the pauseddate from Powershel AZ.sql Get-AzSqlDatabase

lostsole avatar Aug 25 '22 14:08 lostsole

Thank you for your feedback. This has been routed to the support team for assistance.

ghost avatar Aug 28 '22 11:08 ghost

@lostsole We are looking into it and get back to you for any additional information.

SaurabhSharma-MSFT avatar Aug 29 '22 17:08 SaurabhSharma-MSFT

@lostsole PausedDate is currently not exposed through Get-AzSqlDatabase cmdlet. I will provide your feedback internally so that it can be taken care of in upcoming releases of the Powershell module.

SaurabhSharma-MSFT avatar Sep 15 '22 00:09 SaurabhSharma-MSFT

@lostsole I have submitted a PR to included PausedDate and ResumeDate as Get-AzSqlDatabase output. We will now proceed to close this thread. If there are further questions regarding this matter, please reopen it and we will gladly continue the discussion.

SaurabhSharma-MSFT avatar Oct 11 '22 17:10 SaurabhSharma-MSFT