@@ -18,7 +18,9 @@ package azuretasks
1818
1919import (
2020 "context"
21+ "strings"
2122
23+ "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm"
2224 "github.com/Azure/azure-sdk-for-go/sdk/azcore/to"
2325 network "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/network/armnetwork"
2426 "k8s.io/klog/v2"
@@ -95,13 +97,11 @@ func (nsg *NetworkSecurityGroup) Find(c *fi.CloudupContext) (*NetworkSecurityGro
9597 if len (rule .Properties .SourceApplicationSecurityGroups ) > 0 {
9698 var sasgs []* string
9799 for _ , sasg := range rule .Properties .SourceApplicationSecurityGroups {
98- asg , err := azure . ParseApplicationSecurityGroupID (* sasg .ID )
100+ asg , err := arm . ParseResourceID (* sasg .ID )
99101 if err != nil {
100- if err != nil {
101- return nil , err
102- }
102+ return nil , err
103103 }
104- sasgs = append (sasgs , & asg .ApplicationSecurityGroupName )
104+ sasgs = append (sasgs , to . Ptr ( strings . ToLower ( asg .Name )) )
105105 }
106106 nsr .SourceApplicationSecurityGroupNames = sasgs
107107 }
@@ -111,13 +111,11 @@ func (nsg *NetworkSecurityGroup) Find(c *fi.CloudupContext) (*NetworkSecurityGro
111111 if len (rule .Properties .DestinationApplicationSecurityGroups ) > 0 {
112112 var dasgs []* string
113113 for _ , dasg := range rule .Properties .DestinationApplicationSecurityGroups {
114- asg , err := azure . ParseApplicationSecurityGroupID (* dasg .ID )
114+ asg , err := arm . ParseResourceID (* dasg .ID )
115115 if err != nil {
116- if err != nil {
117- return nil , err
118- }
116+ return nil , err
119117 }
120- dasgs = append (dasgs , & asg .ApplicationSecurityGroupName )
118+ dasgs = append (dasgs , to . Ptr ( strings . ToLower ( asg .Name )) )
121119 }
122120 nsr .DestinationApplicationSecurityGroupNames = dasgs
123121 }
0 commit comments