Open florinangelescu opened 3 years ago
It is a very popular cmdlet and should not have issue. @florinangelescu , please share the debug message of cmdlet execution. You can turn on it via $DebugPreference = "Continue"
We have reproduce this issue. When the name is invalid, it goes through all resource groups and return null if no hit. It should be a bug and will be fixed.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.
Author: | florinangelescu |
---|---|
Assignees: | - |
Labels: | `Service Attention`, `bug`, `question`, `ARM - Core`, `customer-reported` |
Milestone: | - |
According to current implementation https://github.com/Azure/azure-powershell/blob/5794114e0bc8c0639c4e8905528a10520743da3e/src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs#L883, the parameter -Name
has 2 usages. If it is just the normal string, cmdlet gets resource group by that name. If the value contains wildcard characters, it executes query and compares the return result. Get-AzResourceGroup -Name "https://RG1?default"
is the second case that it triggers the query and return null because there is no matched result.
Even with the wildcard, the returned result is still not correct. Also, there is no statement whatsoever in the official documentation on this behavior. The outcome of the cmdlet should be consistent no matter what the input. So I still go with the fact that it is a bug and needs to be addressed.
Get Outlook for Androidhttps://aka.ms/AAb9ysg
From: Dingmeng Xue @.> Sent: Thursday, August 12, 2021 8:39:42 AM To: Azure/azure-powershell @.> Cc: Florin Angelescu @.>; Mention @.> Subject: Re: [Azure/azure-powershell] Get-AzResourceGroup returns false positive (#15612)
According to current implementation https://github.com/Azure/azure-powershell/blob/5794114e0bc8c0639c4e8905528a10520743da3e/src/Resources/ResourceManager/SdkClient/ResourceManagerSdkClient.cs#L883https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fblob%2F5794114e0bc8c0639c4e8905528a10520743da3e%2Fsrc%2FResources%2FResourceManager%2FSdkClient%2FResourceManagerSdkClient.cs%23L883&data=04%7C01%7C%7C35d094d3e1eb4752273008d95d53961b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637643435844945669%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=SRRyEN98NevaKiOIytTMivSj1Pr%2BbKfUAIcxCSBE1Ck%3D&reserved=0, the parameter -Name has 2 usages. If it is just the normal string, cmdlet gets resource group by that name. If the value contains wildcard characters, it executes query and compares the return result. Get-AzResourceGroup -Name "https://RG1?default" is the second case that it triggers the query and return null because there is no matched result.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FAzure%2Fazure-powershell%2Fissues%2F15612%23issuecomment-897363499&data=04%7C01%7C%7C35d094d3e1eb4752273008d95d53961b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637643435844955664%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=Wve98%2FZtJ0Z15DNWe7F58kb4bIENa%2BM%2FH3bi%2Fx2E%2FP4%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAK64RBD24YS4IKLKYHMOKT3T4NNB5ANCNFSM5BQ5AVOQ&data=04%7C01%7C%7C35d094d3e1eb4752273008d95d53961b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637643435844965660%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=9X0sapxRFpqMZkF7fQih4rS6pXCzjJofGkNkDXMs39A%3D&reserved=0. Triage notifications on the go with GitHub Mobile for iOShttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7C%7C35d094d3e1eb4752273008d95d53961b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637643435844965660%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jpHZu0W%2F9hGZVI7JNG56LeuH%2BWGwZMgQjk9oTEEN5Mk%3D&reserved=0 or Androidhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26utm_campaign%3Dnotification-email&data=04%7C01%7C%7C35d094d3e1eb4752273008d95d53961b%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637643435844975654%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=TvcjA9rfluNwuUXFAnkMckPvsdLTPOHVXK2Ih3AUv8Y%3D&reserved=0.
@armleads-azure, @dingmeng-xue Following up to see if there is any update on this issue? - Thank you
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.
Author: | florinangelescu |
---|---|
Assignees: | - |
Labels: | `Service Attention`, `question`, `ARM - Core`, `customer-reported` |
Milestone: | - |
@florinangelescu Apologies for the late reply. Thanks for your feedback. We will update this thread once we have more details.
@armleads-azure Could you please provide an update on this once you get a chance ? Awaiting your reply.
Description
When using unconventional names for the resource group value (URLs), the cmdlet doesn't return anything as result.
Steps to reproduce
Resource group RG1 exists. Resource group RG2 does not exists.
Returns the details of the resource group.
Fails and says the provided resource group does not exist.
Doesn't return anything, but it also doesn't fail. In an automation we have, we are validating the resource group name and you can imagine this leads to false positive results (when the cmdlet doesn't fail). Also, logically, this doesn't have any sense. It should either return the results of the resource group details or fail. How can it be that it has a 3rd option?
Environment data
Module versions
Debug output
Error output