'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?



Solution 1:[1]

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/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 RahulKumarShaw-MT