azure-sdk-for-ruby icon indicating copy to clipboard operation
azure-sdk-for-ruby copied to clipboard

network api NetworkSecurityGroup#name is nil

Open akostadinov opened this issue 7 years ago • 1 comments

Hi, I'm obtaining instance security group. #name is always nil.

      nic_ref = instance.network_profile.network_interfaces.find { |nic|
        nic.primary
      }
      m = nic_ref.id.match(%r{/resourceGroups/([^/]+)/.*/([^/]+)$})
      nic = net_client.network_interfaces.get(m[1], m[2])
      security_group = nic.network_security_group
      return security_group&.name

The result is always nil whether or not security_group exists or not.

Same with Subnet:

      # expand option might help: https://stackoverflow.com/questions/52121456
      subnet_id = nic.ip_configurations.find {|ipc| ipc.primary}.subnet.id
      m = subnet_id.match(%r{/resourceGroups/([^/]+)/.*/virtualNetworks/([^/]+)/subnets/([^/]+)$})
      subnet = net_client.subnets.get(m[1], m[2], m[3])
      security_group = subnet.network_security_group
      return security_group&.name

I need to parse out the name from the #id string.

akostadinov avatar Aug 31 '18 19:08 akostadinov

This is a service related issue. The service returns nil value. I have notified the service team and the Network label has been added. I will follow up with them and update this issue soon.

sarangan12 avatar Sep 10 '18 20:09 sarangan12

Thank you for your interest in Azure SDKs. As detailed in this retirement announcement, this repo is no longer supported as of December 31st 2021. Please find the up-to-date list of languages and services supported with Azure SDKs here: https://aka.ms/azsdk

kurtzeborn avatar Jan 11 '23 03:01 kurtzeborn