Hi all. How can I pass authentication credentials ...
# ask-community
j
Hi all. How can I pass authentication credentials to adls2_resource? The docs show the yaml required which I can enter manually into the webserver but I would like to automate. I assume I use a RunConfig but not totally sure. Many thanks for your help.
🤖 1
s
Hi James, In what context are you looking to execute a job with this resource? Do you just want the config to be set in advance when executing via the Dagster UI?
j
Hi Sean, thanks for getting back to me. Yes I just want the config set in advance. I’m just working locally without a dagster.yaml so ideally I don’t need to create one.
s
It should be possible using the legacy
configured
API: https://docs.dagster.io/concepts/configuration/configured#configured-api- However I recommend using the new-style `ADLS2Resource`:
Copy code
from dagster import asset, Definitions
from dagster_azure.adls2.resources import ADLS2Resource

@asset
def some_asset_using_adls2(adls2: ADLS2Resource):
    ...

defs = Definitions(
    assets=[some_asset_using_adls2],
    resources={"adls2": ADLS2Resource(credentials=...)}
)
j
Thanks that worked. Really appreciate the support!