By Eleanor
I have a few namespaces which host Functions based in different regions. I’d like to use doctl to switch between the different Function namespaces for easy deployment, however I’m running into an issue when I attempt to use doctl serverless connect
. When running this command I receive a prompt to select the namespace I would like to connect to. After making my selection I receive the following message:
Error: GET https://api.digitalocean.com/v2/functions/namespaces/{namespace-id}: 403 You are not authorized to perform this operation
I’ve done the following troubleshooting:
doctl auth list
to ensure that I was using the correct auth contextdoctl serverless connect
again. In all situations I ensured the token had full function
scopeSo far I’ve only been able to successfully use this command when using an API token that has the full access scope. What are the granular scopes I can enable so I can use doctl serverless connect
without requiring an API token that has full access enabled?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Accepted Answer
Heya, @eldemetriou
The doctl serverless connect
command requires the token to have full access to Functions. I believe currently, DigitalOcean’s granular API token scopes don’t provide a separate “read” or “limited” scope for Functions. This means that to perform operations like serverless connect
, the token needs at least the Function scope.
If granular scopes for Functions do not work for this specific command:
doctl serverless connect
.Steps:
doctl auth init --context functions-admin
This will allow you to switch between contexts for operations requiring broader permissions:
doctl auth switch --context functions-admin
Hope that this helps!
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.