Can't access external endpoint even after adding them in the manifest.yml

I’m trying to connect to the Azure service.

azure.jsx:45 Refused to connect to 'https://resource_name.openai.azure.com/openai/deployments/gpt-4o/chat/completions?api-version=2024-02-15-preview' because it violates the document's Content Security Policy.

I have added the URL to the manifest.yml file under permission, external, fetch, backend.

I’m still not able to access it using api.fetch from forge/api .

I have tried uninstalling the instance and installing it back.

The last option I had is to create a new app but wanted to check with the community if there is something I can do.

Hey @sandyinspires,

I’m just making a guess, are you making the API call via an invoke method / resolver ?

I’m not sure whether you have a UI kit app or Custom UI app,

In UI kit apps non-product (or external) API requests need to go through the lambda, and so you will need to set up a Resolver. See Forge resolver. If you’re building a UI Kit app, there’s a tutorial in our Forge Quest docs that takes you through setting up an app to use an external API.

Similarly, in Custom UI apps, you cannot fetch APIs from your static assets. Instead, you must use the invoke method from the custom UI bridge to run an Atlassian-hosted backend FaaS function, where you may fetch from your desired APIs, and return the required data to the frontend.

I hope this helps!
Mel

Thanks, I’m using api.fetch from forge/api.

I have to add the URL in both the backend and client

permissions:
  scopes:
    - storage:app
    - read:page:confluence
    - write:page:confluence
  external:
    fetch:
      backend:
        - url_1
        - url_2
      client:
        - url_1
        - url_2

Phew! difficult make things work here.

I didn’t use resolver - I’m using UI Kit.

@sandyinspires for UI Kit apps, you need to use a resolver to call an external API

Are you working on a new or old UI kit app?
Did you create your app using forge create from the Forge CLI?