-
Notifications
You must be signed in to change notification settings - Fork 334
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
azure_rm_adapplication_info - failed to get application info 'dict' object has no attribute 'get_all' #1338
Comments
SDK bug : microsoftgraph/msgraph-sdk-python#466 |
@Elrau you can use the |
Thanks for your return and the information about the bug. Unfortunately in my usecase I can't use the |
This looks related to issue 451 My comment should apply. Basically your setting a dict where its expecting the "HeaderColleciton" class. Use the request_configuration.headers.try_add('HEADERKEY','HEADERVALUE') instead. If you share code, I can fix for you. I resolved it by reviewing the SDK source. |
@A360-Paul Looks like the headers has been deleted from request configuration. So I remove the headers in the request configuration and the this bug fixed. async def get_applications(self, sub_filters):
if sub_filters:
request_configuration = ApplicationsRequestBuilder.ApplicationsRequestBuilderGetRequestConfiguration(
query_parameters=ApplicationsRequestBuilder.ApplicationsRequestBuilderGetQueryParameters(
filter=(' and '.join(sub_filters)),
),
headers={'ConsistencyLevel': "eventual"},
)
return await self._client.applications.get(request_configuration=request_configuration)
else:
return await self._client.applications.get() |
I'm getting this same issue on the azure_rm_adgroup_info module. I'd imagine it'd be the exact same fix, could you look into it @xuzhang3 ? |
@xPancaker Seems the same issue, can you share your configuration file? |
I'm also getting the same issue with azure_rm_adgroup module. Playbook - name: "AAD"
hosts: localhost
connection: local
tags:
- "AAD"
tasks:
- name: Create Group
azure.azcollection.azure_rm_adgroup:
display_name: "MY_GROUP_NAME"
mail_nickname: "MY_GROUP_NICK_NAME"
object_id: "MY_GROUP_OBJECT_ID"
auth_source: credential_file
profile: default
state: 'present' Credentials file
|
My config file isn't much, just points to some custom plugins and hides skipped_hosts. [defaults]
display_skipped_hosts = no
filter_plugins = ./filter_plugins |
@xPancakery @juniinacio #1355 will fix this issue. |
I will give it a try as soon as possible, and let you know. |
@xuzhang3 that fixed the issue for a day by adding a pre-task to pull the dev branch, but now it's again not working with the same error? - name: Install specific azcollection
shell:
cmd: "ansible-galaxy collection install git+https://github.com/ansible-collections/azure.git,dev" |
@xPancakery can you share your script and the error logs? |
Portion of the script with the relevant call: - name: Gather USER MEMBERSHIP information from Azure Active Directory and compile relevant lists
block:
- name: Get user memberships for all Azure AD Groups
azure.azcollection.azure_rm_adgroup_info:
tenant: "{{ tenant }}"
client_id: "{{ client_id }}"
secret: "{{ secret }}"
subscription_id: "{{ subscription_id }}"
all: true
return_group_members: True
register: ad_group_membership_initial Error in AWX: {
"msg": "failed to get ad group info 'dict' object has no attribute 'get_all'",
"invocation": {
"module_args": {
"tenant": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"client_id": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"secret": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"subscription_id": "VALUE_SPECIFIED_IN_NO_LOG_PARAMETER",
"all": true,
"return_group_members": true,
"auth_source": "auto",
"cloud_environment": "AzureCloud",
"api_profile": "latest",
"return_owners": false,
"return_member_groups": false,
"profile": null,
"ad_user": null,
"password": null,
"cert_validation_mode": null,
"adfs_authority_url": null,
"log_mode": null,
"log_path": null,
"x509_certificate_path": null,
"thumbprint": null,
"object_id": null,
"attribute_name": null,
"attribute_value": null,
"odata_filter": null,
"check_membership": null
}
},
"deprecations": [
{
"msg": "tenant ID has been deprecated and will be removed in the future. See the Azure documentation for more information: https://learn.microsoft.com/en-us/graph/migrate-azure-ad-graph-request-differences#example-request-comparison",
"version": "2.0.0",
"collection_name": "azure.azcollection"
}
],
"_ansible_no_log": null,
"changed": false
} |
@xPancakery This issue should be fix by #1355 |
SUMMARY
Hello,
Tried to upgrade from version 1.16 to new 2.0. Code works fine before that.
ISSUE TYPE
When I try to get AD Application info by its identifier URL, I got a message
failed to get application info 'dict' object has no attribute 'get_all'
COLLECTION VERSION
STEPS TO REPRODUCE
EXPECTED RESULTS
Task performs correctly and get AAD App info if exist or a specific string if not
ACTUAL RESULTS
Task fail with message :
failed to get application info 'dict' object has no attribute 'get_all'
The text was updated successfully, but these errors were encountered: