I'm having trouble with my `prefect.yaml` as well ...
# ask-community
d
I'm having trouble with my
prefect.yaml
as well - it doesn't seem to be downloading the flow code:
here's the flow:
Copy code
import httpx
from prefect import flow


@flow(log_prints=True)
def get_repo_info(repo_name: str = "PrefectHQ/prefect"):
    url = f"<https://api.github.com/repos/{repo_name}>"
    response = httpx.get(url)
    response.raise_for_status()
    repo = response.json()
    print(f"{repo_name} repository statistics 🤓:")
    print(f"Stars 🌠 : {repo['stargazers_count']}")
    print(f"Forks 🍴 : {repo['forks_count']}")


if __name__ == "__main__":
    print("This is my-first-deployment")
    get_repo_info.deploy(
        name="my-first-deployment",
        work_pool_name="arte-k8s",
        image="prefecthq/prefect:2-python3.11-conda",
        build=False
    )
and here's my `prefect.yaml`:
Copy code
name: workers_test
prefect-version: 2.14.4

build: null

push:
- prefect_azure.deployments.steps.push_to_azure_blob_storage:
    id: push_code
    requires: prefect-azure>=0.2.8
    container: prefect-server
    folder: Deployments
    credentials: "{{ prefect.blocks.azure-blob-storage-credentials.my-credentials-block }}" 

pull:
- prefect_azure.deployments.steps.pull_from_azure_blob_storage:
    id: pull_code
    requires: prefect-azure>=0.2.8
    container: '{{ push_code.container }}'
    folder: '{{ push_code.folder }}'
    credentials: "{{ prefect.blocks.azure-blob-storage-credentials.my-credentials-block }}" 

deployments:
- name: null
  version: null
  tags: []
  description: null
  schedule: {}
  flow_name: null
  entrypoint: null
  parameters: {}
  work_pool:
    name: arte-k8s
    work_queue_name: default
    job_variables: {}
  push: push_code
  pull: pull_code
any help would be appreciated 🙂
k
it looks like you've created your deployment using
.deploy()
, so you don't need a
prefect.yaml
The
prefect.yaml
file is read when running
prefect deploy -n <my_deployment_name>
via the CLI. Both
prefect deploy
and
.deploy()
achieve the outcome of creating a deployment, so you only need to use one of them.
If you're looking to use azure blob storage as your code storage, check out these examples for
.deploy()
.
d
ah cool - thanks!