Couldn't find api version for Microsoft.DataFactory/factories?api-version=2018-06-01

215 Views Asked by At

I am querying the data factories within a resource group but I couldn't make it work. I can query it through the rest api but not through azure_rm_resource_info ansible module:

- name: Check if Data Factory ({{ az_datafactory_name }}) already exists
azure.azcollection.azure_rm_resource_info:
  auth_source: auto
  client_id: "{{ az_client_id }}"
  secret: "{{ az_secret }}"
  tenant: "{{ az_tenant_id }}"
  subscription_id: "{{ az_subscription_id }}"
  url: "https://management.azure.com/subscriptions/{{ az_subscription_id }}/resourceGroups/{{ az_resource_group_name }}/providers/Microsoft.DataFactory/factories?api-version=2018-06-01"
register: az_datafactory

Output: fatal: [localhost]: FAILED! => {"changed": false, "msg": "Couldn't find api version for Microsoft.DataFactory/factories?api-version=2018-06-01"}

1

There are 1 best solutions below

0
Rustan Rodriguez On

Thanks for the tip of @MrVitaminP. Changing the url seems to solve my problem:

url: "https://management.azure.com/subscriptions/{{ az_subscription_id }}/resourceGroups/{{ az_resource_group_name }}/providers/Microsoft.DataFactory/factories"