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

AzOps - Pull fails with MissingApiVersionParameter #644

Closed
CerveloRS opened this issue May 27, 2022 · 10 comments · Fixed by #651
Closed

AzOps - Pull fails with MissingApiVersionParameter #644

CerveloRS opened this issue May 27, 2022 · 10 comments · Fixed by #651
Assignees
Labels
area/powershell enhancement New feature or request

Comments

@CerveloRS
Copy link

CerveloRS commented May 27, 2022

Description

When running AzOps - Pull to get all policies, resources, resourcegroups, and roles on two managementgroups (and whatever is below), the pipeline fails on step Initialize with following error (some information replaced with replaced):

[06:32:35][Get-AzOpsRoleAssignment] Retrieving Role Assignments at scope /subscriptions/replaced/resourceGroups/replaced WARNING: [06:33:55][Invoke-AzOpsScriptBlock] Tried unsuccessfully 6 out of 6 times, giving up. | MissingApiVersionParameter : The api-version query parameter (?api-version=) is required for all requests. CorrelationId: 95e29d50-26aa-445e-b4e0-15a538da9302 Exception: The running command stopped because the preference variable

Steps to reproduce

  1. Run AzOps Pull with attached settings.

AzOps Module version 1.8.1

settings.json.zip

@CerveloRS CerveloRS changed the title Bug Report AzOps - Pull fails with MissingApiVersionParameter May 27, 2022
@daltondhcp
Copy link
Contributor

Looks like a transient issue in ARM, did it ever work before or did it start after a specific configuration change?

@daltondhcp daltondhcp added waiting-for-response Maintainers have replied and are awaiting a response from the bug/issue/feature creator triage labels May 27, 2022
@daltondhcp
Copy link
Contributor

daltondhcp commented May 27, 2022

After taking a closer look in the backend, it looks like it is failing on some Microsoft.Web/certificates resources that you have in some of your resource groups. Can you please try and add Microsoft.Web/certificates to the "Core.SkipResourceType" array in settings.json and try again? Microsoft.Web is a bit of uncharted territory for us in terms of pull, so hopefully excluding certificates will be enough :)

@CerveloRS
Copy link
Author

It is not transient. The error always occurs on the same resourcegroup at:

Retrieving Role Assignments at scope /subscriptions/replaced/resourceGroups/replaced

@daltondhcp
Copy link
Contributor

daltondhcp commented May 27, 2022

The roleAssignments message is unfortunately misleading, it is failing on what I mentioned above according to the correlationid. Looks very similar to #464

@CerveloRS
Copy link
Author

It does look similar.
Added the exclusion. Now failing with correlationId 53f82858-a440-4300-8e15-94af477d66f0.
Please advise in troubleshooting the correlationids.

@daltondhcp
Copy link
Contributor

daltondhcp commented May 27, 2022

The correlationIds are only for backend ARMlogs investigation, so unfortunately not something you can do on your own. We will investigate and look at a more graceful way to handle such resource provider failures.
In the meantime, you can disable resource discovery to restore pull operations without resources in RGs (roles and policies will still be included)

@CerveloRS
Copy link
Author

Sadly the purpose of this repo and pipeline is to fetch the resources (as a backup of resources not deployed as code), but I will try some more exclusions and see if I get there.

@BenjaminEngeset
Copy link

@CerveloRS

I have the same similar issue, but for now excludeded it to be pulled. The consequence is that you don't have your state, so I have ended up blocking manual operations in the portal for these resource types.

It is not the best way if you have shared responsibility around these resource declarations, but for now it seems like the best fit.

@daltondhcp
Copy link
Contributor

It does look similar. Added the exclusion. Now failing with correlationId 53f82858-a440-4300-8e15-94af477d66f0. Please advise in troubleshooting the correlationids.

The above correlationId is interestingly enough related to the same resource type (Microsoft.Web/certificates). Can you double check spelling etc?

Nevertheless, we will look at changing the way we handle these types of failures and instead throw a warning for child/auxiliary resources that cannot be exported.

@daltondhcp daltondhcp added enhancement New feature or request area/powershell and removed triage labels May 28, 2022
@CerveloRS
Copy link
Author

Spelling was fine.

Warning rather then fail would be a welcome change.
Maybe even as a setting so one can choose to fail or warn?

@daltondhcp daltondhcp self-assigned this Jun 2, 2022
@daltondhcp daltondhcp added this to the Release - v1.8.2 milestone Jun 2, 2022
@daltondhcp daltondhcp linked a pull request Jun 7, 2022 that will close this issue
5 tasks
@Jefajers Jefajers removed the waiting-for-response Maintainers have replied and are awaiting a response from the bug/issue/feature creator label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/powershell enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants