Azure / Azure/azure-powershell

[Az.Automanage] the report name of response contains the 'default' prefix

Open
#19,761 0 comments 0 reactions 0 assignees View on GitHub
Automanage bug Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

When execute `Get-AzAutomanageReport` obtain report information, the report name contains the 'default' prefix. But the "default" prefix needs to be removed when sending the request with the report name.

### Issue script & Debug output

```PowerShell
Get-AzAutomanageReport -ConfigurationProfileAssignmentName default -ResourceGroupName automangerg -VMName aglinuxvm

Name ResourceGroupName
---- -----------------
default/a261e96e-90bd-4feb-bed6-c9e1fb436d51 automangerg
default/787969f2-d8b2-4f33-afb3-f3636880884e automangerg
default/638cc61a-70d9-4a88-9ffc-f5a49e981dd7 automangerg
default/8cbcf4be-6f16-480b-85ac-4c0392ff0476 automangerg
default/20640074-b8fd-4e27-abc3-7c9440ea40db automangerg
default/0a9e1d06-6903-4580-8876-84ab7be07239 automangerg
default/6ae85795-33c1-45e9-8823-3124e53378ab automangerg
default/ec6183de-759e-4db2-ae94-142d0d65c33a automangerg
default/7a865a92-8000-49ef-9765-b843055619b2 automangerg
default/5a9a12ec-c63f-45cc-9568-0e15e89b61e0 automangerg
default/af0fa24c-35d2-420d-a46b-f0fe378cf015 automangerg
default/4960c434-aa36-4072-ad67-32f2a6f25472 automangerg
default/0ffe854d-9bba-4221-bb3f-8f1c98ae749b automangerg
default/5c768928-2bd9-4d17-a414-bbd59dbd1430 automangerg
default/2bae3a13-1dbb-4846-9e99-0c375163ac79 automangerg
default/d9ec093d-5ac2-40f2-b065-2e319f077907 automangerg
default/65fa937d-1c19-4ed1-b17c-f4153d5433e1 automangerg
default/73eeacd1-5ba5-43a9-b767-a09cfd0e6397 automangerg
default/5d807444-26a6-4f79-babc-3b9c4aef0415 automangerg

Get-AzAutomanageReport -ResourceGroupName automangerg -VMName aglinuxvm -Name default/a261e96e-90bd-4feb-bed6-c9e1fb436d51
Get-AzAutomanageReport_Get: The server responded with a Request Error, Status: NotFound

Get-AzAutomanageReport -ConfigurationProfileAssignmentName default -ResourceGroupName automangerg -VMName aglinuxvm -Name a261e96e-90bd-4feb-bed6-c9e1fb436d51

Name ResourceGroupName
---- -----------------
default/a261e96e-90bd-4feb-bed6-c9e1fb436d51 automangerg
```

### Environment data

```PowerShell
Name Value
---- -----
PSVersion 7.1.4
PSEdition Core
GitCommitId 7.1.4
OS Microsoft Windows 10.0.22621
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
```

### Module versions

```PowerShell
ModuleType Version PreRelease Name ExportedCommands
---------- ------- ---------- ---- ----------------
Script 2.10.1 Az.Accounts {Add-AzEnvironment, Clear-AzConfig, Clear-AzConte…
Script 0.1.0 Az.Automanage {Get-AzAutomanageBestPractice, Get-AzAutomanageCo…
```

### Error output

```PowerShell
HistoryId: 4

Message : The server responded with a Request Error, Status: NotFound
StackTrace :
Exception : Microsoft.Azure.PowerShell.Cmdlets.Automanage.Runtime.RestException`1[Microsoft.Azure.PowerShell.Cmdle
ts.Automanage.Models.Api20.IErrorResponse]
InvocationInfo : {Get-AzAutomanageReport_Get}
Line : Get-AzAutomanageReport -ResourceGroupName automangerg -VMName aglinuxvm -Name
default/a261e96e-90bd-4feb-bed6-c9e1fb436d51
Position : At line:1 char:1
+ Get-AzAutomanageReport -ResourceGroupName automangerg -VMName aglinux …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 4

The Azure PowerShell team is listening, please let us know how we are doing: https://aka.ms/azpssurvey?Q_CHL=ERROR.
```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with Get-AzAutomanageReport using the PowerShell commands and parameters shown, comparing the returned Name with the name accepted by a follow-up request. Done means the report name is represented consistently so the displayed value can be used in the request without the unwanted default prefix.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.