none
My docker container running a windows OS will not connect to my azure storage account. RRS feed

  • Question

  • I have a cli tool that I package into a docker container with a windows os and deploy it as an azure container instance. When the tool is run, one of the first things that it does is access my azure storage account to load a settings.json file. 

    When I run the file from my local docker engine, it has no issues connecting to the azure storage account. When I package the tool into a Linux container and mount it as an azure container instance, it has no issues connecting to the azure storage account. However, I ran into other issues with my Linux container, so I decided to build a Windows container to host the tool. 

    When I create the container instance on Azure with the windows OS, the log tells me it cannot connect to the storage account. 

    Just to clarify -> local docker engine has no issues to connect to my azure storage account. Mount the image onto a container instance on Azure, and I get the following error below. 

    My storage account and container instance are located on the same subscription. I connect via a connection string and my storage account is open to all networks. 

    Thanks


    Unhandled exception. Microsoft.Azure.Storage.StorageException: No such host is known.
     ---> System.Net.Http.HttpRequestException: No such host is known.
     ---> System.Net.Sockets.SocketException (11001): No such host is known.
       at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
       --- End of inner exception stack trace ---
       at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.ConnectAsync(HttpRequestMessage request, Boolean allowHttp2, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.CreateHttp11ConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.GetHttpConnectionAsync(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
       at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
       at System.Net.Http.HttpClient.FinishSendAsyncUnbuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
       at Microsoft.Azure.Storage.Core.Executor.Executor.ExecuteAsync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token)
       --- End of inner exception stack trace ---
       at Microsoft.Azure.Storage.Core.Executor.Executor.ExecuteAsync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext, CancellationToken token)
       at Microsoft.Azure.Storage.Core.Executor.Executor.<>c__DisplayClass0_0`1.<ExecuteSync>b__0()
       at Microsoft.Azure.Storage.Core.Util.CommonUtility.RunWithoutSynchronizationContext[T](Func`1 actionToRun)
       at Microsoft.Azure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)
       at Microsoft.Azure.Storage.Blob.CloudBlob.Exists(Boolean primaryOnly, BlobRequestOptions options, OperationContext operationContext)
       at Microsoft.Azure.Storage.Blob.CloudBlob.Exists(BlobRequestOptions options, OperationContext operationContext)
       at MLRecognizers.Helpers.JsonOptions.LoadJsonAsync(String fileName) in C:\Code\Cloud Data Tools\DataTools\MLRecognizerTools\Helpers\JsonSetupOptions.cs:line 29
       at ReportJsonGenerator.CLT.AnalyzerCLI.Main(String[] args) in C:\Code\Cloud Data Tools\DataTools\ReportJsonGenerator.CLI\AnalyzerCLI.cs:line 55
       at ReportJsonGenerator.CLT.AnalyzerCLI.<Main>(String[] args)
    Request Information
    RequestID:
    RequestDate:
    StatusMessage:
    ErrorCode:
    
    Tuesday, July 30, 2019 2:52 PM

All replies

  • What Windows OS version are you using? 
    Tuesday, July 30, 2019 7:42 PM
    Owner
  • Hello! 

    Windows server 1809.

    I am pulling this image for my docker container:

    FROM mcr.microsoft.com/dotnet/core-nightly/sdk:3.0.100-preview7-nanoserver-1809


    Tuesday, July 30, 2019 7:57 PM
  • Thanks for that. One other thing to confirm, you are just pulling a file from the storage account correct? Not mounting the storage account as a file share in the container
    Tuesday, July 30, 2019 9:54 PM
    Owner
  • Yes that is correct. I am pulling the file from an Azure storage account on the same subscription. 

    Wednesday, July 31, 2019 2:02 AM
  • Thanks for confirming :) 

    It's hard to say what the exact issue is without digging into any of the backend logs. 

    I believe getting this solved would be simpler if we get you in touch with Azure Technical Support. Do you have the ability to open a technical support ticket? If not, you can email me at AzCommunity@microsoft.com and provide me with your Azure SubscriptionID and link to this thread. I can then enable your subscription for a free support request. 

    Wednesday, July 31, 2019 7:21 PM
    Owner
  • Hi, thanks for getting back to me. 

    It seems the windows containers in general have issues accessing networks. I am not sure if it is deliberate, but that was the main issue. Basically, I found the one Windows docker image that allows Windows to talk to the outside world and my issue has been resolved. 

    For those having similar issues, please see this article for more details. 

    Edit: Since I do not have permissions to post links, look up the msdn issue: "Unable to do DNS lookup from a Windows container in Azure Container Instance"

    Thanks
    Wednesday, July 31, 2019 7:30 PM
  • Ahhhh that's right! I completely forgot about issue. We did find an issue with one of the Windows issues and the DNS resolution 

    So the work around was to use the following

    mcr.microsoft.com/windows/nanoserver:1903

    https://hub.docker.com/_/microsoft-windows-nanoserver/

    They are working to fix the other image as well but I have no ETA on when it will be corrected. 

    Wednesday, July 31, 2019 7:35 PM
    Owner
  • No no, the work around was to use:

    mcr.microsoft.com/dotnet/core/runtime:2.1-nanoserver-sac2016

    Thanks,


    Wednesday, July 31, 2019 7:51 PM