title: Azure CLI Login within Docker Container
body: <p>I have successfully created a docker image that runs inside a docker container.  The container successfully executes the image (a .NET app) but the image crashes shortly after startup because it encounters an error with Azure Services.  The reason is because the docker container is attempting to access Azure Services to fetch an authorization token (to fetch secrets from a key vault) and does not have authority to do so.</p>
  
  <p>I should note that it is possible to run the app locally outside of a container via the Azure CLI after using <code>az login</code> to verify my credentials.  Then, when the app is started via Azure CLI, it is 'allowed' to access Azure Services to get autho tokens and consequentially fetch data from my key vault.</p>
  
  <p>Would like to know if there is a way to run an <code>az login</code> script with credentials inside a docker container before the .NET app image executes, so that I can start the application from within the Azure CLI (inside the container) after my credentials have been verified.  I have looked through the documentation and have not seen a way to configure something like this.</p>