https://prefect.io logo
Title
s

Shivam Yadav

03/17/2023, 8:57 AM
Hello Everyone, I am running a flow in my local system using Pycharm and trying to connect Prefect. I am using API Authentication and i am able to connect to Prefect. I wanted to access Prefect Blocks and using below code :
import prefect
from prefect import flow, task
import json
from prefect_databricks import DatabricksCredentials
from prefect_databricks.flows import jobs_runs_submit_and_wait_for_completion
import scripts
from prefect.blocks.system import Secret, String
from prefect_databricks import DatabricksCredentials
from prefect.blocks.system import Secret, String
@flow(name='Databricks-Flow')
def databricks_flow():
    secret_block = Secret.load("prd-databricks-token")
    print(secret_block)
if __name__ == "__main__":
    databricks_flow()
While executing this i am getting below error: Can anyone please help me in resolving this. FYI: This Piece of code is perfectly working in my friends system.
raise PrefectHTTPStatusError.from_httpx_error(exc) from exc.__cause__
prefect.exceptions.PrefectHTTPStatusError: Client error '403 Forbidden' for url '<https://api.prefect.cloud/api/accounts/470d1ece-3f38-482c-8641-2b9756b4781e/workspaces/b7f3ff33-c0b3-4c1e-b1a3-794ef4f674b1/flows/>'
Response: {'detail': 'Forbidden'}
For more information check: <https://httpstatuses.com/403>