概要
https://qiita.com/keisuke-umezawa/items/fcf5d00474e244217a5e
で環境構築中に出たエラーへの対処です。
要はAPIでVM作成するのに、利用規約に同意する必要があるってことです。利用規約をよく読んでご対応ください。
エラーの例
$ az vm create --location ${AZ_LOCATION} --resource-group ${AZ_RESOURCE_GROUP} --name ${AZ_USER}-vm --admin-username ${AZ_USER} --public-ip-address-dns-name ${AZ_USER} --image microsoft-ads:linux-data-science-vm-ubuntu:linuxdsvmubuntu:latest --size Standard_NC6 --generate-ssh-keys
Azure Error: MarketplacePurchaseEligibilityFailed
Message: Marketplace purchase eligibilty check returned errors. See inner errors for details.
Exception Details:
Error Code: BadRequest
Message: Offer with PublisherId: microsoft-ads, OfferId: linux-data-science-vm-ubuntu 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) or deploy via the Azure portal to accept the terms":"StoreApi"}]
$