Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Get-AzDataProtectionPolicyTemplate" for AzureDatabaseForPGFlexServer is not recognizing via github actions #24853

Open
zameer712 opened this issue May 8, 2024 · 2 comments
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported DataProtection needs-author-feedback More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue.

Comments

@zameer712
Copy link

Description

"Get-AzDataProtectionPolicyTemplate" for AzureDatabaseForPGFlexServer is not recognizing via github actions

Same its working and recognising for PostgreSQL Single server but for flexible server its not working

Below out put for the same

usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command $env:PSModulePath
45/usr/share:/home/runner/.local/share/powershell/Modules:/usr/local/share/powershell/Modules:/opt/microsoft/powershell/7/Modules
46Initializing Az Module Complete
47Running Az PowerShell Script
48/usr/bin/pwsh -NoLogo -NoProfile -NonInteractive -Command /home/runner/work/_temp/8718b09c-cb4c-4732-aa34-c0f900fb80c6.ps1
49Uninstall-Package: No match was found for the specified search criteria and module names 'Az'.
51Name Location AdministratorLogin Version StorageProfileStorageMb
52---- -------- ------------------ ------- -----------------------
53weucathsurpsql01 westeurope psqladminsurcdt 11 30720
54DatasourceType : {Microsoft.DBforPostgreSQL/servers/databases}
55ObjectType : BackupPolicy
56PolicyRule : {BackupWeekly, Default}
57Script execution Complete

Issue script & Debug output

Uninstall-Package: No match was found for the specified search criteria and module names 'Az'.
51Get-AzDataProtectionPolicyTemplate: /home/runner/work/_temp/ff25746d-1e43-4e99-b56a-7db060b5bcb1.ps1:12
52Line |
53  12 | Get-AzDataProtectionPolicyTemplate
54     | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55     | Cannot process command because of one or more missing mandatory
56     | parameters: DatasourceType.

Environment data

name: Backup for flexible server contract

on:
  workflow_dispatch:
    inputs:
      environment:
        type: choice        
        description: 'Choose Environment'
        default: 'test-cdt'      
        options: 
        - 'test-cdt'
permissions:
  id-token: write
  contents: read

jobs:
  contract-backup:
    runs-on: ubuntu-latest
    if: inputs.environment == 'test-cdt'
    environment: cdt
    steps:
    - name: Checkout code
      uses: actions/checkout@v3


    - name: OIDC Login to Azure Public Cloud with AzPowershell (enableAzPSSession true)
      uses: azure/login@v2
      with:
        client-id: <Client id>
        tenant-id: <Tenant id>
        subscription-id: <Subscription id>
        enable-AzPSSession: true 

    - name: Azure CLI script
      uses: azure/CLI@v1
      with:
        azcliversion: latest
        inlineScript: |
            az account show

    - name: Azure PowerShell script
      uses: azure/powershell@v2
      with:
        inlineScript: |
            Uninstall-Module -Name Az -AllVersions
            Install-Module -Name Az -Repository PSGallery -Force
            # Check if the module is installed
            $ResourceGroupName = '<resourcegroup>'
            $SubscriptionName = '<subscription_id>'
            $POSTGRESQL_SERVER_NAME = '<servername>'
            $BACKUP_VAULT_NAME = '<vaultname>'
            $BACKUP_INSTANCE_NAME = 'pgflexibackupinstance'
            $postgreSqlServer = Get-AzPostgreSqlFlexibleServer -SubscriptionId $SubscriptionName -ResourceGroupName $ResourceGroupName -Name $POSTGRESQL_SERVER_NAME
            $postgreSqlServer
            Get-AzDataProtectionPolicyTemplate

        azPSVersion: "latest"

Module versions

Uninstall-Package: No match was found for the specified search criteria and module names 'Az'.
51Get-AzDataProtectionPolicyTemplate: /home/runner/work/_temp/ff25746d-1e43-4e99-b56a-7db060b5bcb1.ps1:12
52Line |
53  12 | Get-AzDataProtectionPolicyTemplate
54     | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55     | Cannot process command because of one or more missing mandatory
56     | parameters: DatasourceType.

Error output

Uninstall-Package: No match was found for the specified search criteria and module names 'Az'.
51Get-AzDataProtectionPolicyTemplate: /home/runner/work/_temp/ff25746d-1e43-4e99-b56a-7db060b5bcb1.ps1:12
52Line |
53  12 | Get-AzDataProtectionPolicyTemplate
54     | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55     | Cannot process command because of one or more missing mandatory
56     | parameters: DatasourceType.
@zameer712 zameer712 added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels May 8, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported needs-triage This is a new issue that needs to be triaged to the appropriate team. and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels May 8, 2024
@isra-fel
Copy link
Member

Can you check the version of Az.DataProtection used? You can do that by Get-Module Az.DataProtection -ListAvailable.

@isra-fel isra-fel added needs-author-feedback More information is needed from author to address the issue. DataProtection and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels May 16, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the no-recent-activity There has been no recent activity on this issue. label May 23, 2024
Copy link
Contributor

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported DataProtection needs-author-feedback More information is needed from author to address the issue. no-recent-activity There has been no recent activity on this issue.
Projects
None yet
Development

No branches or pull requests

2 participants