When going to the Azure Portal -> Virtual Machines -> Create VM -> (select location and VM size, and check the "Azure Spot Instance" box) -> Click "View pricing history and compare prices in nearby regions", users I've given the generic "Reader" role to are seeing this:
Looking at the web inspector, there is an authorization error saying: "The client 'xxxx' with object id 'xxxx' does not have authorization to perform action 'Microsoft.Compute/locations/spotPriceHistory/bulkQuery/action' over scope '/subscriptions/xxxx' or the scope is invalid. If access was recently granted, please refresh your credentials."
Signing out and back in didn't help, so, I tried creating a custom role with the following properties:
{
"Name": "Spot Price History Reader",
"IsCustom": true,
"Description": "View Spot VM Price History",
"Actions": [
"Microsoft.Compute/locations/spotPriceHistory/bulkQuery/action"
],
"NotActions": [],
"DataActions": [],
"NotDataActions": [],
"AssignableScopes": [
"/subscriptions/xxxx"
]
}
Using the az CLI to create the role definition...
az role definition create --role-definition @spot_reader.json
But the az CLI is giving me the following error:
'Microsoft.Compute/locations/spotPriceHistory/bulkQuery/action' does not match any of the actions supported by the providers.
I've tried other variations of that action, but nothing seems to work. Is there a built-in role or other action value that I can use to give my users access to view spot VM pricing history, without giving them access to create VMs?