简体   繁体   中英

Authenticate docker running locally - azure

I have managed identity enabled on azure AML and can access the AML workspace when running the code locally via vscode as it is authenticated by the current session which is authenticated when code is run after az login

When I build the docker image inside the code I am trying to get AML workspace using:

ws = Workspace.from_config('config.json')

But as the docker will run locally, it can't be authenticated by azure and thus can't access the workspace.

Is there any way to pass some kind of token while running the docker or some other way so that the azure can authenticate my locally running docker?

For login into azure using local running docker, you can use the below command.

you can log in without interaction (typically in scripts or continuous integration scenarios), using an Azure Service Principal, with docker login.

azure --client-id xx --client-secret yy --tenant-id zz

Reference: https://docs.docker.com/cloud/aci-integration/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM