C# Fluent SDK fails to create container group/instance intermittently

Deanna Delapasse 1 Reputation point
2021-10-01T20:02:26.35+00:00

We are trying to create some container groups (with one instance each), but we are getting intermittent errors as listed below. It waits for 30 minutes and then fails. We're creating an Azure ticket, but would love any ideas on what is going on.

: IPMonitor.Jobs.NotificationJob[0]
Error on CreateContainerACR: Microsoft.Rest.Azure.CloudException: Long running operation failed with status 'Failed'.
Additional Info:'Prepare network succeeded.;Join network succeeded.;Delegate subnet succeeded.;
Provision network interface failed for "xxxxxxxxx"/"sn-use-paas-dev"/"yyyyyyyyyyyyyyyy":
Failed to create network container.;Provision network interface succeeded.;Subscription deployment didn't reach a successful provisioning state after '00:30:00'.'
at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO2.CheckForErrors() at Microsoft.Rest.ClientRuntime.Azure.LRO.PutLRO2.CheckForErrors()
at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO2.StartPollingAsync() at Microsoft.Rest.ClientRuntime.Azure.LRO.AzureLRO2.BeginLROAsync()
at Microsoft.Rest.Azure.AzureClientExtensions.GetLongRunningOperationResultAsyncTBody,THeader

We're using the Microsoft Fluent SDK:

var containerGroup = await azure.ContainerGroups.Define(aCREnvVars.ContainerGroupName + suffix)
.WithRegion("East US")
.WithExistingResourceGroup(aCREnvVars.resourceGrop)
.WithLinux()
.WithPrivateImageRegistry(aCREnvVars.acrLoginServer, aCREnvVars.acrName, aCREnvVars.acrPassword)
.DefineVolume(aCREnvVars.VolumeName)
.WithExistingReadWriteAzureFileShare(aCREnvVars.azure_file_volume_share_name)
.WithStorageAccountName(aCREnvVars.azure_file_volume_account_name)
.WithStorageAccountKey(aCREnvVars.azure_file_volume_account_key)
.Attach()
.DefineContainerInstance(aCREnvVars.ContainerGroupName)
.WithImage(aCREnvVars.acrLoginServer + "/" + aCREnvVars.PythonImageName)
.WithExternalTcpPort(80)
.WithCpuCoreCount(CpuCoreCount)
.WithMemorySizeInGB(MemorySizeInGB)
.WithEnvironmentVariables(envVar)
.WithVolumeMountSetting(aCREnvVars.VolumeName, aCREnvVars.MountPath)
.Attach()
.WithRestartPolicy(ContainerGroupRestartPolicy.Never)
.WithNetworkProfileId(aCREnvVars.network_profile_subscriptions, aCREnvVars.resourceGrop, aCREnvVars.network_profile_name)
.CreateAsync();

Azure Container Registry
Azure Container Registry
An Azure service that provides a registry of Docker and Open Container Initiative images.
373 questions
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
625 questions
{count} votes