question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot create Container Instance using External Udp Port

See original GitHub issue

I’m running the following code to create a container instance with an external Udp port.

IContainerGroup containerGroup = await azure.ContainerGroups.Define(aciName)
               .WithRegion(region)
               .WithNewResourceGroup("myrg")
               .WithLinux()
               .WithPrivateImageRegistry("myserver", "myuser", "mypassword")
               .WithoutVolume()
               .DefineContainerInstance(aciName)
                   .WithImage("myImage")
                   .WithExternalUdpPort(4900)
                   .WithCpuCoreCount(1)
                   .WithMemorySizeInGB(1.5)
                   .Attach()
               .CreateAsync(CancellationToken.None)

I’m getting the following exception:

Following ports ‘4900’ in the ‘ipAddress’ are not used by any container in container group ‘acis11amplef3033472’.

Please note that if change the code to use WithExternalTcpPort it creates the container group and instance as expected.

StackTrace

Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: CreateContainer —> Microsoft.Rest.Azure.CloudException : Following ports ‘4900’ in the ‘ipAddress’ are not used by any container in container group ‘acis11amplef3033472’. at async Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerGroupsOperations.CreateOrUpdateWithHttpMessagesAsync(String resourceGroupName,String containerGroupName,ContainerGroupInner containerGroup,Dictionary2 customHeaders,CancellationToken cancellationToken) at async Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerGroupsOperationsExtensions.CreateOrUpdateAsync(IContainerGroupsOperations operations,String resourceGroupName,String containerGroupName,ContainerGroupInner containerGroup,CancellationToken cancellationToken) at async Microsoft.Azure.Management.ContainerInstance.Fluent.ContainerGroupImpl.CreateResourceAsync(CancellationToken cancellationToken) at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.ResourceActions.Creatable4.<Microsoft-Azure-Management-ResourceManager-Fluent-Core-ResourceActions-IResourceCreatorIResourceT>-CreateResourceAsyncIFluentResourceT,InnerResourceT,FluentResourceT,IResourceT at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.CreatorTaskItem1.ExecuteAsync[IResourceT](CancellationToken cancellationToken) at async Microsoft.Azure.Management.ResourceManager.Fluent.Core.DAG.TaskGroupBase1.ExecuteNodeTaskAsync[TaskResultT](DAGNode1 node,CancellationToken cancellationToken) at async AciFunction.Aci.RunAsync(HttpRequestMessage req,TraceWriter log) at async Microsoft.Azure.WebJobs.Host.Executors.FunctionInvoker2.InvokeAsync[TReflected,TReturnValue](Object instance,Object[] arguments) at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.InvokeAsync(IFunctionInvoker invoker,ParameterHelper parameterHelper,CancellationTokenSource timeoutTokenSource,CancellationTokenSource functionCancellationTokenSource,Boolean throwOnTimeout,TimeSpan timerInterval,IFunctionInstance instance) at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithWatchersAsync(IFunctionInstance instance,ParameterHelper parameterHelper,TraceWriter traceWriter,CancellationTokenSource functionCancellationTokenSource) at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??) at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??) End of inner exception at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.ExecuteWithLoggingAsync(??) at async Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.TryExecuteAsync(IFunctionInstance functionInstance,CancellationToken cancellationToken) at Microsoft.Azure.WebJobs.Host.Executors.ExceptionDispatchInfoDelayedException.Throw() at async Microsoft.Azure.WebJobs.JobHost.CallAsync(??) at async Microsoft.Azure.WebJobs.Script.ScriptHost.CallAsync(String method,Dictionary2 arguments,CancellationToken cancellationToken) at async Microsoft.Azure.WebJobs.Script.WebHost.WebScriptHostManager.HandleRequestAsync(FunctionDescriptor function,HttpRequestMessage request,CancellationToken cancellationToken) at async Microsoft.Azure.WebJobs.Script.Host.FunctionRequestInvoker.ProcessRequestAsync(HttpRequestMessage request,CancellationToken cancellationToken,WebScriptHostManager scriptHostManager,WebHookReceiverManager webHookReceiverManager) at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.<>c__DisplayClass3_0.<ExecuteAsync>b__0(??) at async Microsoft.Azure.WebJobs.Extensions.Http.HttpRequestManager.ProcessRequestAsync(HttpRequestMessage request,Func3 processRequestHandler,CancellationToken cancellationToken) at async Microsoft.Azure.WebJobs.Script.WebHost.Controllers.FunctionsController.ExecuteAsync(HttpControllerContext controllerContext,CancellationToken cancellationToken) at async System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken) at async System.Web.Http.Dispatcher.HttpControllerDispatcher.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken) at async Microsoft.Azure.WebJobs.Script.WebHost.Handlers.WebScriptHostHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken) at async Microsoft.Azure.WebJobs.Script.WebHost.Handlers.SystemTraceHandler.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken) at async System.Web.Http.HttpServer.SendAsync(HttpRequestMessage request,CancellationToken cancellationToken)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hovsepmcommented, Mar 27, 2018

The fix was shipped in v1.8. Please upgrade.

1reaction
milismsftcommented, Mar 19, 2018

@ejadib the current plan is to release it early next week

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to deploy azure container with no incoming port due ...
I'm attempting to deploy a container on a private subnet that doesn't require an incoming port but requires an IP for outbound connection ......
Read more >
How to expose multiple ports on Azure Container Instance?
I'd like to run the equivalent of: docker run -p 80:80 -p 443:443 ... I've unsuccessfully tried: Maps only the last port: az...
Read more >
UDP Port Mapping - Sending data from Container to Host
So the question is: how do I create / run a docker container such that I am transmitting data, from inside the container,...
Read more >
Trouble with networking in 1 direction - General Discussions
Inside the container the server listens on udp port 0.0.0.0:12000, all packets sent to it arrive correctly and it processes them.
Read more >
PortMapping - Amazon Elastic Container Service
Port mappings allow containers to access ports on the host container ... Only the tasks that Amazon ECS services create are supported with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found