I do not use a default Azure subscription, so I need to use -SubscriptionName with Add-WinGetManifest. It appears this parameter is ignored in the implementation and as such the underlying cmdlets continue to try to use the default subscription which subsequently fails.
Using Connect-AzAccount and Set-AzContext prior to execution does not change the outcome of this.
PS D:\b\winget-cli-restsource\bin> add-wingetmanifest -FunctionName "XXX" -Path "D:\b\winget-pkgs\manifests\path_to_manifest" -Verbose -SubscriptionName "XXX"
VERBOSE: Populating RepositorySourceLocation property for module Az.Resources.
VERBOSE: Populating RepositorySourceLocation property for module Az.Accounts.
VERBOSE: Populating RepositorySourceLocation property for module Az.Accounts.
VERBOSE: Populating RepositorySourceLocation property for module Az.Websites.
VERBOSE: Populating RepositorySourceLocation property for module Az.Functions.
VERBOSE: Validating connection to azure, will attempt to connect if not already connected.
VERBOSE: Connected to Azure
VERBOSE: No Subscription Name or Subscription Id provided. Will test connection to default Azure Subscription
VERBOSE: Determines the Azure Function Resource Group Name
VERBOSE: Verifying that the Azure Resource XXX exists..
VERBOSE: Azure Resources:
Azure Function Exists: False
Azure Resource Group Exists: True
Write-Error: D:\b\winget-cli-restsource\bin\Library\Add-WinGetManifest.ps1:86:19
Line |
86 | … $Result = Test-AzureResource -FunctionName $AzureFunctionName -Reso …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Both the Azure Function and Resource Group Names can not be null and must exist. Please
| verify that the Azure function and Resource Group exist.
Exception: D:\b\winget-cli-restsource\bin\Library\Add-WinGetManifest.ps1:88:13
Line |
88 | throw "Failed to confirm resources exist in Azure. Please …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Failed to confirm resources exist in Azure. Please verify and try again.
I do not use a default Azure subscription, so I need to use
-SubscriptionName
withAdd-WinGetManifest
. It appears this parameter is ignored in the implementation and as such the underlying cmdlets continue to try to use the default subscription which subsequently fails.Using
Connect-AzAccount
andSet-AzContext
prior to execution does not change the outcome of this.