Api-version 2020-03-01 is not supported
az feedbackauto-generates most of the information requested below, as of CLI version 2.0.62
Describe the bug Az CLI defaults to using an API version not yet supported by the ARM backend.
To Reproduce
- Azure DevOps hosted agent windows-2019
- Az CLI v. 2.1.0.
- Run the following command
az storage account network-rule add --account-name $targetResourceName --resource-group $targetResourceGroup --subnet $sourceSubnetId
- Error returned: "Api-version 2020-03-01 is not supported"
Expected behavior Subnet is added as allowed to target storage account resource.
Environment summary See steps to reproduce.
Additional context Issue began on 3/2 without changes to code. Only identified changes are Az CLI version using on agent.
HI @Juliehzl could you pls have a look? thanks
add to S167
Original input is inaccurate. Further digging on our end has actually narrowed the call down to this function, where the resourceId parameter is a fully qualified subnetId.
function Wait-ResourceProvisioningState{
param(
[Parameter(Mandatory=$true)][string]$resourceId,
[Parameter(Mandatory=$false)][string]$desiredState = "Succeeded"
)
$info = $(az resource show --ids $resourceId) | ConvertFrom-JSON
if (!$info.properties.provisioningState){
Write-Warning "Passed resource does not expose a provisioningState field."
}else{
$i = 0
while($info.properties.provisioningState -ne $desiredState -and $i -lt $CONST_MAX_ATTEMPTS){
Write-Verbose "Desired state '$desiredState' not found for '$resourceId'. Will re-attempt in $CONST_SLEEP_TIME seconds..." -Verbose
Start-Sleep $CONST_SLEEP_TIME
$info = $(az resource show --ids $resourceId) | ConvertFrom-JSON
$i++
}
}
return $info
}
Behavior appears to be intermittent, leading me to believe it's an inconsistency in the backend ARM provider rather than an issue inherent with the CLI itself.
Behavior is no longer occurring, again believed to be a backend issue. Closing issue.