Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.21k stars 3.81k forks source link

Get-AzResource does not work properly with a wildcard in the -Name parameter and the -ExpandProperties switch #13855

Closed w3bward closed 2 years ago

w3bward commented 3 years ago

Description

Get-AzResource returns nothing when a wildcard is specified in the name parameter (e.g. "Environment-*", and the -ExpandProperties switch is applied. If I also use the -ResourceType parameter, it actually throws an error that would seem to suggest that when the -ExpandProperties switch is applied, it is trying to use the wildcard as a literal part of the name.

Using the same value for the name parameter without the -ExpandProperties switch works as expected, and returns the expected results both with and without the -ResourceType parameter applied.

Steps to reproduce

Returns nothing:

$Prefix = "Environment-"
$ResourceGroup = "MyResourceGroupName"
Get-AzResource -Name "$Prefix*" -ResourceGroupName $ResourceGroup -ExpandProperties

Throws an error:

$Prefix = "Environment-"
$ResourceGroup = "MyResourceGroupName"
$Type = 'Microsoft.Logic/workflows'
Get-AzResource -Name "$Prefix*" -ResourceGroupName $ResourceGroup -ResourceType $Type -ExpandProperties

Works as expected:

$Prefix = "Environment-"
$ResourceGroup = "MyResourceGroupName"
$Type = 'Microsoft.Logic/workflows'
Get-AzResource -Name "$Prefix*" -ResourceGroupName $ResourceGroup -ResourceType $Type

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.19041.610
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.19041.610
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     1.9.0      Az.Accounts                         {Add-AzEnvironment, Clear-AzContext, Clear-AzDefault, Connect-AzAccount...}
Script     2.2.0      Az.Resources                        {Add-AzADGroupMember, Export-AzResourceGroup, Get-AzADAppCredential, Get-AzADApplication...}
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...}
Manifest   3.0.0.0    Microsoft.PowerShell.Security       {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature...}
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Manifest   3.0.0.0    Microsoft.WSMan.Management          {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP...}
Script     1.4.7      PackageManagement                   {Find-Package, Find-PackageProvider, Get-Package, Get-PackageProvider...}
Script     2.2.4.1    PowerShellGet                       {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability...}
Script     2.0.0      PSReadline                          {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler...}

Debug output

$LogicApps = Get-AzResource -ResourceGroupName Redacted -ResourceType 'Microsoft.Logic/workflows' -ResourceName "$EnvironmentPrefix*" -ExpandProperties -Debug
DEBUG: 1:48:03 PM - GetAzureResourceCmdlet begin processing with ParameterSet 'ByTagNameValueParameterSet'.

Confirm
Continue with this operation?
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): a
DEBUG: 1:48:04 PM - using account id 'Redacted'...
DEBUG: [Common.Authentication]: Authenticating using Account: 'Redacted', environment: 'AzureCloud', tenant: 'Redacted'
DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: 'Redacted', Endpoint: 'https://login.microsoftonline.com/', ClientId: 'Redacted', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob',
ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/Redacted/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True'
DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: 'Redacted', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: 'Redacted', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is
running...
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is
running...
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition started:
 CacheType: null
 Authentication Target: User
 , Authority Host: login.microsoftonline.com
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition started:
 Authority: https://login.microsoftonline.com/Redacted/
 Resource: https://management.core.windows.net/
 ClientId: Redacted
 CacheType: null
 Authentication Target: User

DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9449777Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Loading from cache.
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9474356Z: 00000000-0000-0000-0000-000000000000 - LoggerBase.cs: Deserialized 7 items to token cache.
DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Looking up cache for a token...
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: An item matching the requested resource was found in the cache
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: 15.7865178066667 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: 15.7865178066667 minutes left until token in cache expires
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 12/28/2020 10:03:52 PM +00:00
DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 12/28/2020 10:03:52 PM +00:00Access Token Hash:Redacted
  User id: Redacted
DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '12/28/2020 22:03:52 +00:00', MultipleResource? 'True', Tenant: 'Redacted', UserId: 'Redacted'
DEBUG: [Common.Authentication]: User info for token DisplayId: 'Redacted', Name: Redacted, IdProvider: 'https://sts.windows.net/Redacted/', Uid: 'Redacted'
DEBUG: [Common.Authentication]: Checking token expiration, token expires '12/28/2020 22:03:52 +00:00' Comparing to '12/28/2020 21:48:04 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:15:47.1910684'
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://management.azure.com/subscriptions/Redacted/resourceGroups/Redacted/providers/Microsoft.Logic/workflows/Dev-*?api-version=2019-05-01

Headers:
User-Agent                    : PSVersion/v5.1.19041.610,AzurePowershell/v1.0.0
ParameterSetName              : ByTagNameValueParameterSet
CommandName                   : Get-AzResource

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NotFound

Headers:
Pragma                        : no-cache
x-ms-failure-cause            : gateway
x-ms-request-id               : c207c9f6-bd69-4a30-8bb6-2632275c762b
x-ms-correlation-request-id   : c207c9f6-bd69-4a30-8bb6-2632275c762b
x-ms-routing-request-id       : WESTUS2:20201228T214806Z:c207c9f6-bd69-4a30-8bb6-2632275c762b
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Cache-Control                 : no-cache
Date                          : Mon, 28 Dec 2020 21:48:05 GMT

Body:
{
  "error": {
    "code": "ResourceNotFound",
    "message": "The Resource 'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix"
  }
}

Confirm
ResourceNotFound : The Resource 'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
CorrelationId: c207c9f6-bd69-4a30-8bb6-2632275c762b
[Y] Yes  [A] Yes to All  [H] Halt Command  [S] Suspend  [?] Help (default is "Y"): a
Get-AzResource : ResourceNotFound : The Resource 'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
CorrelationId: c207c9f6-bd69-4a30-8bb6-2632275c762b
At line:1 char:14
+ ... LogicApps = Get-AzResource -ResourceGroupName Redacted -Re ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzResource], ErrorResponseMessageException
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet

DEBUG: AzureQoSEvent: CommandName - Get-AzResource; IsSuccess - False; Duration - 00:00:09.2210864;; Exception - Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.ErrorResponses.ErrorResponseMessageException: ResourceNotFound : The Resource
'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
CorrelationId: c207c9f6-bd69-4a30-8bb6-2632275c762b
   at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.HandleException(ExceptionDispatchInfo capturedException)
   at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.ExecuteCmdlet()
   at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord();
DEBUG: Finish sending metric.
DEBUG: 1:48:13 PM - GetAzureResourceCmdlet end processing.

Error output

Message        : ResourceNotFound : The Resource 'Microsoft.Logic/workflows/Environment-*' under resource group 'MyResourceGroupName' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix
                 CorrelationId: c8a13ba8-461a-44c9-a6ac-8316fa172696
StackTrace     :    at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.HandleException(ExceptionDispatchInfo capturedException)
                    at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.ExecuteCmdlet()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord()
Exception      : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.ErrorResponses.ErrorResponseMessageException
InvocationInfo : {Get-AzResource}
Line           : $LogicApps = Get-AzResource -ResourceGroupName MyResourceGroupName -ResourceType 'Microsoft.Logic/workflows' -ResourceName "$Prefix*" -ExpandProperties
Position       : At line:1 char:14
                 + ... LogicApps = Get-AzResource -ResourceGroupName MyResourceGroupName -Re ...
                 +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 40
ghost commented 3 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.

Issue Details
## Description `Get-AzResource` returns nothing when a wildcard is specified in the name parameter (e.g. `"Environment-*"`, and the `-ExpandProperties` switch is applied. If I also use the `-ResourceType` parameter, it actually throws an error that would seem to suggest that when the `-ExpandProperties` switch is applied, it is trying to use the wildcard as a literal part of the name. Using the same value for the name parameter without the `-ExpandProperties` switch works as expected, and returns the expected results both with and without the `-ResourceType` parameter applied. ## Steps to reproduce Returns nothing: ```powershell $Prefix = "Environment-" $ResourceGroup = "MyResourceGroupName" Get-AzResource -Name "$Prefix*" -ResourceGroupName $ResourceGroup -ExpandProperties ``` Throws an error: ```powershell $Prefix = "Environment-" $ResourceGroup = "MyResourceGroupName" $Type = 'Microsoft.Logic/workflows' Get-AzResource -Name "$Prefix*" -ResourceGroupName $ResourceGroup -ResourceType $Type -ExpandProperties ``` Works as expected: ```powershell $Prefix = "Environment-" $ResourceGroup = "MyResourceGroupName" $Type = 'Microsoft.Logic/workflows' Get-AzResource -Name "$Prefix*" -ResourceGroupName $ResourceGroup -ResourceType $Type ``` ## Environment data ``` Name Value ---- ----- PSVersion 5.1.19041.610 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.610 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 ``` ## Module versions ```powershell ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 1.9.0 Az.Accounts {Add-AzEnvironment, Clear-AzContext, Clear-AzDefault, Connect-AzAccount...} Script 2.2.0 Az.Resources {Add-AzADGroupMember, Export-AzResourceGroup, Get-AzADAppCredential, Get-AzADApplication...} Manifest 3.1.0.0 Microsoft.PowerShell.Management {Add-Computer, Add-Content, Checkpoint-Computer, Clear-Content...} Manifest 3.0.0.0 Microsoft.PowerShell.Security {ConvertFrom-SecureString, ConvertTo-SecureString, Get-Acl, Get-AuthenticodeSignature...} Manifest 3.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...} Manifest 3.0.0.0 Microsoft.WSMan.Management {Connect-WSMan, Disable-WSManCredSSP, Disconnect-WSMan, Enable-WSManCredSSP...} Script 1.4.7 PackageManagement {Find-Package, Find-PackageProvider, Get-Package, Get-PackageProvider...} Script 2.2.4.1 PowerShellGet {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability...} Script 2.0.0 PSReadline {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler...} ``` ## Debug output ``` $LogicApps = Get-AzResource -ResourceGroupName Redacted -ResourceType 'Microsoft.Logic/workflows' -ResourceName "$EnvironmentPrefix*" -ExpandProperties -Debug DEBUG: 1:48:03 PM - GetAzureResourceCmdlet begin processing with ParameterSet 'ByTagNameValueParameterSet'. Confirm Continue with this operation? [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): a DEBUG: 1:48:04 PM - using account id 'Redacted'... DEBUG: [Common.Authentication]: Authenticating using Account: 'Redacted', environment: 'AzureCloud', tenant: 'Redacted' DEBUG: [Common.Authentication]: Authenticating using configuration values: Domain: 'Redacted', Endpoint: 'https://login.microsoftonline.com/', ClientId: 'Redacted', ClientRedirect: 'urn:ietf:wg:oauth:2.0:oob', ResourceClientUri: 'https://management.core.windows.net/', ValidateAuthority: 'True' DEBUG: [Common.Authentication]: Acquiring token using context with Authority 'https://login.microsoftonline.com/Redacted/', CorrelationId: '00000000-0000-0000-0000-000000000000', ValidateAuthority: 'True' DEBUG: [Common.Authentication]: Acquiring token using AdalConfiguration with Domain: 'Redacted', AdEndpoint: 'https://login.microsoftonline.com/', ClientId: 'Redacted', ClientRedirectUri: urn:ietf:wg:oauth:2.0:oob DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running... DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: ADAL PCL.Desktop with assembly version '3.19.2.6005', file version '3.19.50302.0130' and informational version '2a8bec6c4c76d0c1ef819b55bdc3cda2d2605056' is running... DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition started: CacheType: null Authentication Target: User , Authority Host: login.microsoftonline.com DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition started: Authority: https://login.microsoftonline.com/Redacted/ Resource: https://management.core.windows.net/ ClientId: Redacted CacheType: null Authentication Target: User DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9444828Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Loading from cache. DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9449777Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Loading from cache. DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9474356Z: 00000000-0000-0000-0000-000000000000 - LoggerBase.cs: Deserialized 7 items to token cache. DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Looking up cache for a token... DEBUG: [ADAL]: Verbose: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: Looking up cache for a token... DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: An item matching the requested resource was found in the cache DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9474356Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: An item matching the requested resource was found in the cache DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: 15.7865178066667 minutes left until token in cache expires DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: 15.7865178066667 minutes left until token in cache expires DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: A matching item (access token or refresh token or both) was found in the cache DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 12/28/2020 10:03:52 PM +00:00 DEBUG: [ADAL]: Information: 2020-12-28T21:48:04.9479316Z: 0feb1fa8-6590-45d1-8142-fb693595d3b4 - LoggerBase.cs: === Token Acquisition finished successfully. An access token was returned: Expiration Time: 12/28/2020 10:03:52 PM +00:00Access Token Hash:Redacted User id: Redacted DEBUG: [Common.Authentication]: Renewing Token with Type: 'Bearer', Expiry: '12/28/2020 22:03:52 +00:00', MultipleResource? 'True', Tenant: 'Redacted', UserId: 'Redacted' DEBUG: [Common.Authentication]: User info for token DisplayId: 'Redacted', Name: Redacted, IdProvider: 'https://sts.windows.net/Redacted/', Uid: 'Redacted' DEBUG: [Common.Authentication]: Checking token expiration, token expires '12/28/2020 22:03:52 +00:00' Comparing to '12/28/2020 21:48:04 +00:00' With threshold '00:05:00', calculated time until token expiry: '00:15:47.1910684' DEBUG: ============================ HTTP REQUEST ============================ HTTP Method: GET Absolute Uri: https://management.azure.com/subscriptions/Redacted/resourceGroups/Redacted/providers/Microsoft.Logic/workflows/Dev-*?api-version=2019-05-01 Headers: User-Agent : PSVersion/v5.1.19041.610,AzurePowershell/v1.0.0 ParameterSetName : ByTagNameValueParameterSet CommandName : Get-AzResource Body: DEBUG: ============================ HTTP RESPONSE ============================ Status Code: NotFound Headers: Pragma : no-cache x-ms-failure-cause : gateway x-ms-request-id : c207c9f6-bd69-4a30-8bb6-2632275c762b x-ms-correlation-request-id : c207c9f6-bd69-4a30-8bb6-2632275c762b x-ms-routing-request-id : WESTUS2:20201228T214806Z:c207c9f6-bd69-4a30-8bb6-2632275c762b Strict-Transport-Security : max-age=31536000; includeSubDomains X-Content-Type-Options : nosniff Cache-Control : no-cache Date : Mon, 28 Dec 2020 21:48:05 GMT Body: { "error": { "code": "ResourceNotFound", "message": "The Resource 'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix" } } Confirm ResourceNotFound : The Resource 'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix CorrelationId: c207c9f6-bd69-4a30-8bb6-2632275c762b [Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): a Get-AzResource : ResourceNotFound : The Resource 'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix CorrelationId: c207c9f6-bd69-4a30-8bb6-2632275c762b At line:1 char:14 + ... LogicApps = Get-AzResource -ResourceGroupName Redacted -Re ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : CloseError: (:) [Get-AzResource], ErrorResponseMessageException + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet DEBUG: AzureQoSEvent: CommandName - Get-AzResource; IsSuccess - False; Duration - 00:00:09.2210864;; Exception - Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.ErrorResponses.ErrorResponseMessageException: ResourceNotFound : The Resource 'Microsoft.Logic/workflows/Dev-*' under resource group 'Redacted' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix CorrelationId: c207c9f6-bd69-4a30-8bb6-2632275c762b at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.HandleException(ExceptionDispatchInfo capturedException) at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord(); DEBUG: Finish sending metric. DEBUG: 1:48:13 PM - GetAzureResourceCmdlet end processing. ``` ## Error output ``` Message : ResourceNotFound : The Resource 'Microsoft.Logic/workflows/Environment-*' under resource group 'MyResourceGroupName' was not found. For more details please go to https://aka.ms/ARMResourceNotFoundFix CorrelationId: c8a13ba8-461a-44c9-a6ac-8316fa172696 StackTrace : at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.HandleException(ExceptionDispatchInfo capturedException) at Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.ResourceManagerCmdletBase.ExecuteCmdlet() at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() Exception : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Entities.ErrorResponses.ErrorResponseMessageException InvocationInfo : {Get-AzResource} Line : $LogicApps = Get-AzResource -ResourceGroupName MyResourceGroupName -ResourceType 'Microsoft.Logic/workflows' -ResourceName "$Prefix*" -ExpandProperties Position : At line:1 char:14 + ... LogicApps = Get-AzResource -ResourceGroupName MyResourceGroupName -Re ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ HistoryId : 40 ```
Author: w3bward
Assignees: -
Labels: `ARM`, `Service Attention`, `customer-reported`, `question`
Milestone: -
pfeileon commented 3 years ago

Potential duplicate of #11248.

SatishBoddu-MSFT commented 2 years ago

Hello @w3bward @pfeileon Apologies for the delayed response. I see that this issue is opened a long time ago and no further activity had taken place. So wanted to check if you are still looking for assistance on this query? Please let us know.

SatishBoddu-MSFT commented 2 years ago

We will now proceed to close this thread. If there are further questions regarding this matter, please tag me in your reply. We will gladly continue the discussion and we will reopen the issue.

Please also do visit Microsoft Q&A the home for technical questions and answers at Microsoft.