not able to Set-AzMarketplaceTerms due to MFA for Azure

19 views Asked by At

I am trying to accept the terms for a VM image-

Set-AzMarketplaceTerms  -Publisher "canonical" -Product "0001-com-ubuntu-server-jammy" -Name "22_04-lts-gen2" -Accept

But it gives error-

Get-AzMarketplaceTerms : SharedTokenCacheCredential authentication unavailable. Token acquisition failed for user [email protected]. Ensure that you have authenticated with a developer tool that supports Azure single sign on. At C:\Users\mr65302\Documents\WindowsPowerShell\Modules\Az.MarketplaceOrdering\2.0.0\custom\Set-AzMarketplaceTerms.ps1:173 char:17

  • ... $termsObj = Get-AzMarketplaceTerms -Name $Name -OfferType ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [Get-AzMarketplaceTerms_Get], CredentialUnavailableException
    • FullyQualifiedErrorId : Microsoft.Azure.PowerShell.Cmdlets.MarketplaceOrdering.Cmdlets.GetAzMarketplaceTerms_Get

Set-AzMarketplaceTerms : The property 'Accepted' cannot be found on this object. Verify that the property exists and can be set. At line:1 char:1

  • Set-AzMarketplaceTerms -Publisher "canonical" -Product "0001-com-ubu ...
  •   + CategoryInfo          : InvalidOperation: (:) [Set-AzMarketplaceTerms], RuntimeException
      + FullyQualifiedErrorId : PropertyNotFound,Set-AzMarketplaceTerms
    
    
    

with same credentials i am able to accept the terms and create the VM in the portal. but it is throwing error as i am trying to deploy from terraform code. it seems to be due to Multi level Authentification.

open to Any suggestions

0

There are 0 answers