Azure / Azure/azure-powershell

Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL not working

Open
#24,839 3 comments 0 reactions 0 assignees View on GitHub
bug customer-reported needs-team-attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

I am trying to execute below command as part of my script but it fails.
Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPostgreSQL

[51](https://github.com/Maersk-Global/Athena_Backup_Restore/actions/runs/8964959796/job/24617578726#step:6:52)Get-AzDataProtectionPolicyTemplate: /home/runner/work/_temp/ff25746d-1e43-4e99-b56a-7db060b5bcb1.ps1:12
[52](https://github.com/Maersk-Global/Athena_Backup_Restore/actions/runs/8964959796/job/24617578726#step:6:53)Line |
[53](https://github.com/Maersk-Global/Athena_Backup_Restore/actions/runs/8964959796/job/24617578726#step:6:54) 12 | Get-AzDataProtectionPolicyTemplate
[54](https://github.com/Maersk-Global/Athena_Backup_Restore/actions/runs/8964959796/job/24617578726#step:6:55) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[55](https://github.com/Maersk-Global/Athena_Backup_Restore/actions/runs/8964959796/job/24617578726#step:6:56) | Cannot process command because of one or more missing mandatory
[56](https://github.com/Maersk-Global/Athena_Backup_Restore/actions/runs/8964959796/job/24617578726#step:6:57) | parameters: DatasourceType.

NOTE : I am able to run this on Azure CLoudShell and PowerShell, hence doesnt seems to be cmdlet issue but platform.

### Issue script & Debug output

```PowerShell
Get-AzDataProtectionPolicyTemplate -DatasourceType AzureDatabaseForPGFlexServer
```

### Environment data

```PowerShell
Latest
```

### Module versions

```PowerShell
2.3.0
```

### Error output

```PowerShell
na
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing Get-AzDataProtectionPolicyTemplate with AzureDatabaseForPostgreSQL and AzureDatabaseForPGFlexServer using Az module 2.3.0 in the reported execution environment, then compare the behavior with Azure CloudShell and PowerShell. Done means the datasource parameter is accepted consistently in the affected environment and the reported command completes without the missing-parameter error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, postgresql, powershell
Domain
cloud, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.