Can not use "--network-profile" with IP address type "Public"
See original GitHub issueDescribe the bug
Even with --ip-address Private
i’m getting error message that IP address type is “Public”
Location: West Europe
Command Name
az container create
Errors:
Can not use "--network-profile" with IP address type "Public".
To Reproduce:
- Create or have an existing networking profile pointing to a specific subnet inside VNET
az container create --resource-group myresourcegroup --ip-address Private --name testcli --image nginx --network-profile profilename
Expected Behavior
Container is created.
Environment Summary
Windows-10-10.0.19041-SP0
Python 3.6.8
Installer: MSI
azure-cli 2.18.0
Extensions:
azure-devops 0.18.0
Additional Context
I swear this used to work. Below is the details of the networking profile.
[
{
"containerNetworkInterfaceConfigurations": [
{
"containerNetworkInterfaces": [
{
"id": "***",
"resourceGroup": "myresourcegroup"
},
{
"id": "***",
"resourceGroup": "myresourcegroup"
}
],
"etag": "W/\"f993fb7a-d846-48f4-9fb7-4cc70b9f8691\"",
"id": "***",
"ipConfigurations": [
{
"etag": "W/\"f993fb7a-d846-48f4-9fb7-4cc70b9f8691\"",
"id": "***",
"name": "ci_subnet_ipconf",
"provisioningState": "Succeeded",
"resourceGroup": "myresourcegroup",
"subnet": {
"addressPrefix": null,
"addressPrefixes": null,
"delegations": null,
"etag": null,
"id": "***",
"ipAllocations": null,
"ipConfigurationProfiles": null,
"ipConfigurations": null,
"name": null,
"natGateway": null,
"networkSecurityGroup": null,
"privateEndpointNetworkPolicies": null,
"privateEndpoints": null,
"privateLinkServiceNetworkPolicies": null,
"provisioningState": null,
"purpose": null,
"resourceGroup": "vnet-resource-group",
"resourceNavigationLinks": null,
"routeTable": null,
"serviceAssociationLinks": null,
"serviceEndpointPolicies": null,
"serviceEndpoints": null
},
"type": "Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations/ipConfigurations"
}
],
"name": "ci_subnet_cni",
"provisioningState": "Succeeded",
"resourceGroup": "myresourcegroup",
"type": "Microsoft.Network/networkProfiles/containerNetworkInterfaceConfigurations"
}
],
"containerNetworkInterfaces": [
{
"container": {
"id": "",
"resourceGroup": "myresourcegroup"
},
"containerNetworkInterfaceConfiguration": {
"containerNetworkInterfaces": null,
"etag": null,
"id": "***",
"ipConfigurations": null,
"name": null,
"provisioningState": null,
"resourceGroup": "myresourcegroup",
"type": null
},
"etag": "W/\"f993fb7a-d846-48f4-9fb7-4cc70b9f8691\"",
"id": "***",
"ipConfigurations": [],
"name": "bec970e9-3411-4377-9960-ef1492f790d2_ci_subnet_cni",
"provisioningState": "Succeeded",
"resourceGroup": "myresourcegroup",
"type": "Microsoft.Network/networkProfiles/containerNetworkInterfaces"
},
{
"container": {
"id": "***",
"resourceGroup": "myresourcegroup"
},
"containerNetworkInterfaceConfiguration": {
"containerNetworkInterfaces": null,
"etag": null,
"id": "***",
"ipConfigurations": null,
"name": null,
"provisioningState": null,
"resourceGroup": "myresourcegroup",
"type": null
},
"etag": "W/\"f993fb7a-d846-48f4-9fb7-4cc70b9f8691\"",
"id": "***",
"ipConfigurations": [],
"name": "63beb899-e461-4a7b-a70e-20e9fc4ccd40_ci_subnet_cni",
"provisioningState": "Succeeded",
"resourceGroup": "myresourcegroup",
"type": "Microsoft.Network/networkProfiles/containerNetworkInterfaces"
}
],
"etag": "W/\"f993fb7a-d846-48f4-9fb7-4cc70b9f8691\"",
"id": "***",
"location": "westeurope",
"name": "profilename",
"provisioningState": "Succeeded",
"resourceGroup": "myresourcegroup",
"resourceGuid": "***",
"tags": {},
"type": "Microsoft.Network/networkProfiles"
}
]
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top Results From Across the Web
Cannot change network profile from Public to Private
1. Windows Key+I to invoke Settings > Network & Internet > Wi-Fi (or any other choice as per your requirement) > Manage known...
Read more >Azure Container Instances: deploy to private ip with yml
Private IP address is only supported when network profile is defined. I can not find in documentation, how should I provide private network?...
Read more >Learn more about network profiles in vRealize Automation ...
When using static IP, the address range is managed by vRealize ... in a blueprint that have a network type: public property are...
Read more >Use private Wi-Fi addresses on iPhone, iPad, iPod touch, and ...
If the device always uses the same Wi-Fi MAC address across all networks, network operators and other network observers can more easily relate ......
Read more >What is a Private IP Address?
Because — and you may not realize this — you have both a public and a ... As a matter of fact, the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just remove the --ip-address Private if you are specifying a Network Profile and it should create it with a private IP anyways - that might be a workaround - it seemed to work for us.
@davehcdn your workaround only works if the resource doesn’t exist prior to executing the command. Removing the
--ip-address Private
parameter and executing the command gives us the following error:For context, we have the same issue as OP. The full command we execute is:
This command worked with the following CLI versions:
And, I assume, every CLI version in between these two. Worth noting that with us, unlike OP, an older version of the CLI works. Didn’t test with their version (2.18.0) though.
The
Can not use "--network-profile" with IP address type "Public"
error appeared in version 2.29.0 and persists in version 2.29.1 for us.