Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Network] az network profile list --resource-group {} returns empty result #20587

Closed
NimitzDEV opened this issue Dec 2, 2021 · 8 comments
Closed
Assignees
Labels
Container Instances az container customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@NimitzDEV
Copy link

This is autogenerated. Please review and update as needed.

Describe the bug

az network profile list outputs the empty result

This outputs empty results without errors.

Command Name
az network profile list

Errors:


To Reproduce:

Following the document describing how to deploy a container inside a virtual network,

  1. Deploy a container into a new virtual network
az container create \
  --name appcontainer \
  --resource-group myResourceGroup \
  --image mcr.microsoft.com/azuredocs/aci-helloworld \
  --vnet aci-vnet \
  --vnet-address-prefix 10.0.0.0/16 \
  --subnet aci-subnet \
  --subnet-address-prefix 10.0.0.0/24

  1. Try to get networkProfileId for the automated deployment process
az network profile list --resource-group myResourceGroup \
  --query [0].id --output tsv

(There is a subnetIds field in the output of the first step, is this the same?)

Expected Behavior

output a network profile id

Environment Summary

Linux-5.4.0-1063-azure-x86_64-with-debian-10.2 (Cloud Shell), Common Base Linux Delridge (quinault)
Python 3.6.10
Installer: DEB

azure-cli 2.30.0

Extensions:
ai-examples 0.2.5
ssh 0.1.8

Additional Context

@ghost ghost added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Dec 2, 2021
@jiasli
Copy link
Member

jiasli commented Dec 2, 2021

@kairu-ms, could you help take a look?

@jiasli jiasli added the Network az network vnet/lb/nic/dns/etc... label Dec 3, 2021
@ghost ghost removed the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Dec 3, 2021
@dtheodor
Copy link

dtheodor commented Dec 7, 2021

Can you take a look at this? This makes it impossible at the moment to deploy a private IP address in a virtual network through a yaml file with this error

Code: PrivateIPAddressNotSupported
Message: IP Address type in container group 'my_group' is invalid. Private IP address is only supported when network profile is defined.

@kairu-ms kairu-ms added Container Instances az container and removed Network az network vnet/lb/nic/dns/etc... labels Dec 8, 2021
@kairu-ms
Copy link
Contributor

kairu-ms commented Dec 8, 2021

Hi @joseph-porter, can you have a look at this? Thanks.

@joseph-porter
Copy link
Contributor

Looks like the CLI version here is 2.30.0, which no longer uses or creates a Network Profile. The newer API version for ACI has removed Network Profile and now uses the subnet ID property directly for deploying with virtual networks.

The CLI create command in the initial question should still deploy a container in a virtual network, it just no longer creates a Network Profile and instead fills the request to ACI with the proper subnet information used by the more recent API version.

Previous versions of the API still support Network Profile, so those can still be used if you wish to continue using the Network Profile. The last CLI version that automatically creates the Network Profile would be 2.28.0 and could be used if you still want to create Network Profiles via the CLI.

@dtheodor
Copy link

dtheodor commented Dec 14, 2021

CLI was the only practical way to create a network profile. Now you have to call the rest API directly, which for bonus points is hidden from the azure API documentation.

The network profile is needed for the YAML based container group deployment https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet which requires a network profile id. Does the yaml configuration support specifying subnets directly in some undocumented form?

If I am not missing something you hindered this use case when you removed network profile functionality from the most recent CLI versions. Was there any benefit from its removal to the CLI user?

Also the CLI documentation is no longer correct https://docs.microsoft.com/en-us/cli/azure/network/profile?view=azure-cli-latest#az_network_profile_list

To create a network profile, see the create command for the relevant resource. Currently, only Azure Container Instances are supported.

@joseph-porter
Copy link
Contributor

The updated documentation was recently published with details of the changes and example usage: https://docs.microsoft.com/en-us/azure/container-instances/container-instances-vnet

@NimitzDEV
Copy link
Author

This solves my problem, thanks

@dtheodor
Copy link

dtheodor commented Dec 16, 2021

When replacing network profile with subnet ids in the YAML configuration, I get

Code: PrivateIPAddressNotSupported
Message: IP Address type in container group 'smg_logs' is invalid. Private IP address is only supported when network profile is defined.

Running

$ az --version
azure-cli                         2.31.0

core                              2.31.0
telemetry                          1.0.6

Python (Linux) 3.6.10 (default, Dec  3 2021, 05:07:09)
[GCC 5.4.0 20160609]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Container Instances az container customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

5 participants