我正在尝试使用 azure container instance fluent management sdk 启动一个 azure container 实例。我正在使用基于 Windows 的容器。我收到以下错误:
System.Private.CoreLib:执行函数时出现异常:SpinUp。Microsoft.Azure.Management.ContainerInstance.Fluent:不支持映像“/:v1”的操作系统版本。
它使用基于 Linux 的容器完美运行 - 代码:
var credentials = new AzureCredentials(new ServicePrincipalLoginInformation
{
ClientId = "myid",
ClientSecret = "mysecret"
}, "mytenant", AzureEnvironment.AzureGlobalCloud);
var azure = Azure
.Configure()
.WithLogLevel(HttpLoggingDelegatingHandler.Level.Basic)
.Authenticate(credentials)
.WithDefaultSubscription();
var group = azure.ContainerGroups.Define("testFloodscreener")
.WithRegion(Region.USEast)
.WithNewResourceGroup("UFHAEAST")
.WithWindows()
.WithPrivateImageRegistry("<myazurecr>", "<crusername>", "<crpassword>")
.WithoutVolume()
.DefineContainerInstance("<name>")
.WithImage("<azurecr>/<imagename>:<tag>")
.WithoutPorts()
.WithCpuCoreCount(1)
.WithCpuCoreCount(1)
.WithMemorySizeInGB(1)
.Attach()
.WithRestartPolicy(ContainerGroupRestartPolicy.OnFailure)
.Create();
任何帮助表示赞赏 - 我可以手动启动容器实例