https://dagster.io/ logo
#ask-community
Title
# ask-community
j

James Tull

08/17/2023, 2:16 PM
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

sean

08/17/2023, 2:30 PM
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

James Tull

08/17/2023, 2:31 PM
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

sean

08/17/2023, 2:36 PM
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

James Tull

08/17/2023, 3:05 PM
Thanks that worked. Really appreciate the support!