Using Azure Container Registry creating new Azure Container Instance from C#

后端 未结 2 1790
忘了有多久
忘了有多久 2021-01-19 06:46

I have created a Azure Container Registry, and uploaded a custom ACI to the registry - no problem - everything works as intended. I have tried creating an container instance

相关标签:
2条回答
  • 2021-01-19 07:10

    The answer above (ie using full azure registry server name):

    .WithImage("mytestreg.azurecr.io/mytestimage:latest")
    

    seems to be part of the solution, but even with that change I was still seeing this error. Looking through other examples on the web (https://github.com/Azure-Samples/aci-dotnet-create-container-groups-using-private-registry/blob/master/Program.cs) containing what I needed, I changed my azure authentication from:

    azure = Azure.Authenticate(authFilePath).WithDefaultSubscription();
    

    to:

    AzureCredentials credentials = SdkContext.AzureCredentialsFactory.FromFile(authFilePath);
    azure = Azure
        .Configure()
        .WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
        .Authenticate(credentials)
        .WithDefaultSubscription();
    

    and with THAT change, things are now working correctly.

    0 讨论(0)
  • 2021-01-19 07:15

    I had the same problems for the last couple of weeks and I've finally found a solution. You should add your azure registry server name in front of the image name. So following your example change:

    .WithImage("mytestimage/latest")
    

    To:

    .WithImage("mytestreg.azurecr.io/mytestimage:latest")
    

    At least that did it for me, I hope it helps someone else.

    0 讨论(0)
提交回复
热议问题