Set command (az --query sslCertificate.id) difficulty

Copper Contributor

Hello friends,

 

i need some help to tweak my result run via powershell.

 

I want to show only the certificate name to make a smaller tab, but it just shows the entire id. The certificate name appears only at the end. This is also true of WAF policy.

 

And I also want to do a filter just by certificate name.

 

1 - It works, but I want to list just the certificate name (Certified_Company_xXxXx)

 

az network application-gateway http-listener list -g XPTO --gateway-name XPTO --output table --query "[?contains(protocol,'Https')].{Listiner:name, URL:hostName, Certificate:sslCertificate.id}"

 

2 - It works, but I want to list just the certificate name (Certified_Company_xXxXx)

 

az network application-gateway http-listener list -g XPTO --gateway-name XPTO --output table --query "[?protocol=='Https' && sslCertificate.id=='/subscriptions/00000000/resourceGroups/ZZZZZ-EU/providers/Microsoft.Network/applicationGateways/XPTO/sslCertificates/Certified_Company_xXxXx'].{Listiner:name, URL:hostName, Certificate:sslCertificate.id}"

 

3 - It not works


az network application-gateway http-listener list -g XTPO --gateway-name XPTO --output table --query "[?contains(sslCertificate.id,'xXxXx')].{Listiner:name, URL:hostName, Certificate:sslCertificate.id}"

 

az : ERROR: Invalid jmespath query supplied for `--query`: In function contains(), invalid type for value: None, expected one of: ['array', 'string'], received: "null"
No linha:1 caractere:1
+ az network application-gateway http-listener list -g XPTO- ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (ERROR: Invalid ...eceived: "null":String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError

To learn more about --query, please visit: 'https://docs.microsoft.com/cli/azure/query-azure-cli'

 

Thanks.

0 Replies