Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible api version provided for the azure_resource_group resource #716

Open
niven01 opened this issue Feb 22, 2023 · 1 comment
Open

Comments

@niven01
Copy link

niven01 commented Feb 22, 2023

Describe the problem

Inspec is now failing when working with Resource Groups. I am receiving the following error. This was working 2 weeks ago.

  Azure Resource Group : /resourcegroups/my-resource-group /subscriptions/***/resourcegroups/
     ×  Incompatible api version provided for the `azure_resource_group` resource.
     The latest api version suggested by the Azure REST API is 2022-12-01.
     Error message from the Azure REST API:
     The api-version '2022-12-01' is invalid. The supported versions are '2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.

Inpec.yml contents:

name: azure-inspec-tests
title: Azure InSpec Profile
license: Apache-2.0
summary: An InSpec Compliance Profile For Azure
version: 0.1.0
inspec_version: '>= 4.23.15'
depends:
- name: inspec-azure
  url: https://github.com/inspec/inspec-azure/archive/main.tar.gz
supports:
- platform: azure

If we specify api_version 2022-09-01 then the check passes, example:

describe azure_resource_group(name: resource_group, api_version: '2022-09-01') do
  it { should exist }
  its('api_version_used_for_query_state') { should eq 'user_provided' }
  its('api_version_used_for_query') { should eq '2022-09-01' }
end

Possible Solution

I dont have a solution only a work around

@acmcg
Copy link

acmcg commented Oct 9, 2024

Have the same issue but with different version

× azure_resource_groups: Azure: Confirm standard deployment of resource groups (1 failed)
× Azure Resource Group : /resourcegroups/ rg-dev-ae-network /subscriptions/***/resourcegroups/
Incompatible api version provided for the azure_resource_group resource.
The latest api version suggested by the Azure REST API is 2024-08-01.
Error message from the Azure REST API:
The api-version '2024-08-01' is invalid. The supported versions are '2024-06-01-preview,2024-03-01,2023-07-01,2023-07-01-preview,2023-03-01-preview,2022-12-01,2022-11-01-preview,2022-09-01,2022-06-01,2022-05-01,2022-03-01-preview,2022-01-01,2021-04-01,2021-01-01,2020-10-01,2020-09-01,2020-08-01,2020-07-01,2020-06-01,2020-05-01,2020-01-01,2019-11-01,2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants