Thread
#prefect-server
    David Charles

    David Charles

    6 months ago
    Hi I’m having a problem setting secrets using GQL (same with Python client):
    mutation {
      set_secret(input: { name: "FOO", value: "BAR" }) {
        success
      }
    }
    Result:
    {
      "errors": [
        {
          "message": "Cannot query field \"set_secret\" on type \"Mutation\".",
          "locations": [
            {
              "line": 2,
              "column": 3
            }
          ],
          "extensions": {
            "code": "GRAPHQL_VALIDATION_FAILED"
          }
        }
      ]
    }
    Any ideas?
    Version info here:
    {
      "data": {
        "api": {
          "backend": "SERVER",
          "mode": "normal",
          "version": "2022.01.25",
          "core_version": "0.15.13",
          "release_timestamp": "2022-01-25T17:43:26Z"
        }
      }
    }
    Python client:
    import prefect
    prefect.__version__
    '0.15.13'
    Anna Geller

    Anna Geller

    6 months ago
    Hi @David Charles, the Secrets stored in the backend are only available using Prefect Cloud, i.e. you can't use those on Prefect Server since this requires a managed service to ensure those Secrets are properly encrypted and stored in a secure manner. On Server you can leverage local Secrets. Check out this Discourse topic to see how you can set local Secrets https://discourse.prefect.io/t/how-to-set-secrets-e-g-github-access-token-on-server/70
    David Charles

    David Charles

    6 months ago
    Ahhhh - thanks (thought I’d lost the plot)
    Understood - thanks for the snappy reply @Anna Geller 🙂