Azure / Commercial-Marketplace-SaaS-Accelerator

A reference example with sample code for developers interested publishing transactable, Software as a-Service offers in the Microsoft commercial marketplace.
MIT License
179 stars 276 forks source link

Vault not found in subscription fix while Azure Subscription has many vaults #609

Closed sergiisinienok closed 7 months ago

sergiisinienok commented 7 months ago

While using this repo to deploy my Azure Marketplace offers, I faced an error: The Vault '{vaultname}' not found within subscription.

After investigating a bit, I found that az keyvault set-policy --name $KeyVault --object-id $WebAppNamePortalId --secret-permissions get list --key-permissions get list --output $azCliOutput in Deploy.ps1 has some kind of a paging by default and if your Azure Subscription has many vaults, you newly created might not be returned. This leads to The Vault '{vaultname}' not found within subscription. error and unpredictable behavior of the solution.

I found an easy fix for this issue by adding a filter by the resource group.

Hope that it will be helpful to somebody.