I keep getting this error in my Azure batch account: "Allocation failed due to marketplace purchase". My pool allocation is set to "User subscription". I have tried multiple things already, but without success.
I followed the steps from this blog: https://techcommunity.microsoft.com/t5/azure-paas-blog/azure-batch-pool-resizing-failed-allocation-failed-due-to/ba-p/2794640
The weird thing is that the following indeed seems to indicate an issue:
Get-AzMarketplaceTerms -Publisher 'microsoft-azure-batch' -Product 'ubuntu-server-container' -Name '20-04-lts'
Name Product Publisher Accepted Signature PrivacyPolicyLink
---- ------- --------- -------- --------- -----------------
20-04-lts microsoft-azure-batch
The indicated next step raises an Exception:
Get-AzMarketplaceTerms -Publisher 'microsoft-azure-batch' -Product 'ubuntu-server-container' -Name '20-04-lts' | Set-AzMarketplaceTerms -Accept
Exception: /usr/local/share/powershell/Modules/Az.MarketplaceOrdering/2.0.0/exports/ProxyCmdletDefinitions.ps1:537
Line |
537 | $steppablePipeline.Begin($PSCmdlet)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot bind argument to parameter 'Name' because it is an empty string.
Therefore I tried the following, which looks as though it works:
Set-AzMarketplaceTerms -Publisher 'microsoft-azure-batch' -Product 'ubuntu-server-container' -Name '20-04-lts' -Accept
Name Product Publisher Accepted Signature
---- ------- --------- -------- ---------
20-04-lts ubuntu-server-container microsoft-azure-batch True ...
However, when I rerun the Get-AzMarketplaceTerms command directly after it, nothing has changed, and most importantly I still get the error in the Batch account.
I also tried to accept using the azure cli, also without success..
az vm image terms accept --offer ubuntu-server-container --publisher microsoft-azure-batch --sku 20-04-lts
The above does seem to work as
az term show --product ubuntu-server-container --plan 20-04-lts --publisher microsoft-azure-batch
{
"accepted": true,
"id": "..",
"licenseTextLink": "",
"marketplaceTermsLink": "",
"name": "20-04-lts",
"plan": "20-04-lts",
"privacyPolicyLink": "https://privacy.microsoft.com/privacystatement",
"product": "ubuntu-server-container",
"publisher": "microsoft-azure-batch",
"retrieveDatetime": "2023-01-24T15:18:01.7673435Z",
"signature": ".."
"systemData": {
"createdAt": "2023-01-24T15:18:01.814201+00:00",
"createdBy": "..",
"createdByType": "ManagedIdentity",
"lastModifiedAt": "2023-01-24T15:18:01.814201+00:00",
"lastModifiedBy": "2387a668-4176-44f4-8d08-4c689b1af0ba",
"lastModifiedByType": "ManagedIdentity"
},
"type": "Microsoft.MarketplaceOrdering/offertypes"
}
Is there anything else I can do or what I'm missing here? Any help is really appreciated :)