@Vinaayakh G Thanks for getting back, I don't see any issues with the code, could you please use the below rest api call to see if your able to fetch the product policy?
https://learn.microsoft.com/en-us/rest/api/apimanagement/product-policy/list-by-product?view=rest-apimanagement-2022-08-01&tabs=HTTP#code-try-0
How to fix (ResourceNotFound) PoliciesConfiguration not found while fetching product policy
Vinaayakh G
0
Reputation points
Hi,
I am trying to download the current policy of a product that I have just created using the Python SDK. The code for the policy download is
def download_product_policy(api_management_client, resource_group_name, service_name, product_id):
# This function should retrieve the existing policy for the Product
response = api_management_client.product_policy.get(
resource_group_name=resource_group_name,
service_name=service_name,
product_id=product_id,
policy_id='policy' # Assuming 'policy' is the correct policy_id
)
return response.value
But I get the error (ResourceNotFound) PoliciesConfiguration not found.
The values for resource_group_name and service_name are correct because the Product was created using these values. product_id is the name of the created Product.
1 answer
Sort by: Most helpful
-
JananiRamesh-MSFT 26,866 Reputation points
2024-08-15T17:38:45.29+00:00