Azure / Azure/azure-cli

Gets error "Can not use --network-profile with IP address type Public." when creating ACI container group with --ip-address "Private"

Open
#16,785 5 comments 0 reactions 0 assignees View on GitHub
act-observability-squad Container Instances Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug

**Command Name**
az container create

**Errors:**
Can not use "--network-profile" with IP address type "Public".

## To Reproduce:
A subnet with id $SUBNET_ID and a vnet with id $VNET_ID must already exist, and the subnet must be delegated to `Microsoft.ContainerInstance`. A Log Analytics Workspace with id $LAW_ID must exist, and this workspace must have a valid key $LAW_KEY.

Run this

```
az container create --resource-group $RESOURCE_GROUP_NAME \
--command-line "/bin/sh -c 'echo \"container was run!\"'" \
--cpu 1 \
--image alpine \
--ip-address "Private" \
--location westeurope \
--log-analytics-workspace $LAW_ID \
--log-analytics-workspace-key $LAW_KEY \
--memory 0.5 \
--name $CONTAINER_GROUP_NAME \
--network-profile $NETWORK_PROFILE_NAME \
--os-type Linux \
--ports 8080 \
--protocol TCP \
--restart-policy OnFailure \
--subnet $SUBNET_ID \
--subscription $SUBSCRIPTION_ID \
--vnet $VNET_ID
```

## Expected Behavior
When I specify argument `--ip-address "Private"`, I should _not_ get an error which says `Can not use --network-profile with IP address type Public.`. The container group should be deployed without errors.

## Environment Summary
```
Linux-3.10.0-1160.11.1.el7.x86_64-x86_64-with-redhat-7.9-Maipo
Python 3.6.8
Installer: RPM

azure-cli 2.17.1

```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.