0
votes

I've got a strange one here, well I think it's strange. I've been trying to do a deployment using powershell calling some json files, however i get the following error:

Get-AzureRmMarketplaceTerms : Offer with PublisherId: {0} and OfferId: {1} not found. If this offer has been created recently, please allow upto 30 minutes for this offer to be available for Purchase. If error persists, contact support.

The command i run to accept the terms is the same as the one I use on the different images, which works perfectly:

Get-AzureRmMarketplaceTerms -Publisher "MicrosoftWindowsServer" -Product "WindowsServer" -Name "2012-R2-Datacenter"
    | Set-AzureRmMarketplaceTerms -Accept

If I try ot run the install without accepting the terms i get the below message:

Error: Code=BadRequest; Message=Offer with PublisherId: MicrosoftWindowsServer, OfferId: WindowsServer cannot be purchased due to validation errors. See details for more information.[{"Legal terms have not been accepted for this item on this subscription. To accept legal terms using PowerShell, please use Get-AzureRmMarketplaceTerms and Set-AzureRmMarketplaceTerms API(https://go.microsoft.com/fwlink/?linkid=862451)

Any idea how I can get past this?

1
Any more question?Charles Xu

1 Answers

0
votes

When you create Azure resource through deployment using PowerShell you do not accept the terms that while accepting them in the Azure Portal. Then you will get the error you showed.

The PowerShell command that you showed:

Get-AzureRmMarketplaceTerms -Publisher "MicrosoftWindowsServer" -Product "WindowsServer" -Name "2012-R2-Datacenter" | Set-AzureRmMarketplaceTerms -Accept

It's a way to accept the terms when you execute the Azure deployment. For more details, see Accepting Azure Marketplace terms in PowerShell. Good luck!