Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-AzRoleEligibilityScheduleRequest - "The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'" #20429

Closed
NikolaiKleppe opened this issue Dec 12, 2022 · 6 comments
Labels
customer-reported question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Resource Authorization AzRole* in Az.Resources Service Attention This issue is responsible by Azure service team.

Comments

@NikolaiKleppe
Copy link

Description

Running the command:
New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope

Produces this error:
The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.

It also displays a "_CreateExpanded" suffix which I don't really understand, but might not be the reason for this error?

New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
New-AzRoleEligibilityScheduleRequest_CreateExpanded: The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.

Same with Get-AzRoleEligibilityScheduleRequest.
Happens with both required input only and full example from the docs

Am I missing some resource provider or updates?

Tried locally (Windows), Azure Cloud Shell, Azure DevOps with Linux agent using pwsh

I'll post two examples:

Azure Cloud Shell:

$guid = New-Guid    
$scope = "/providers/Microsoft.Management/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/"
New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
New-AzRoleEligibilityScheduleRequest_CreateExpanded: The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Linux 5.4.0-1098-azure #104~18.04.2-Ubuntu SMP Tue Nov 29 12:13:35 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Get-Module Az*                                                             

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.10.4                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     5.2.0                 Az.Compute                          {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}
Script     5.2.0                 Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBackendHttpSetting, Add-AzApplicationGa…
Script     6.5.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     5.2.0                 Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Close-AzStorageFileHandle…}
Script     0.0.0.10              AzureAD.Standard.Preview            {Add-AzureADApplicationOwner, Add-AzureADDeviceRegisteredOwner, Add-AzureADDeviceRegisteredUser, Add-AzureADDirectoryRoleMember…}
Script     0.9.3                 AzurePSDrive 
Get-AzResourceProvider -ProviderNamespace 'Microsoft.Management'

ProviderNamespace : Microsoft.Management
RegistrationState : Registered
ResourceTypes     : {resources}
Locations         : {}
<....>

Locally on Windows

New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
New-AzRoleEligibilityScheduleRequest_CreateExpanded: The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.
$PSVersionTable

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

Script or Debug output

New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: //providers/Microsoft.Management/subscriptions/aca96f2e-569b-47c5-ac1d-1aff644762b5//providers/Microsoft.Authorization/roleEligibilityScheduleRequests/ecaf853d-a5ad-469c-8635-844808fbd254?api-version=2020-10-01-preview
DEBUG: RequestCreated: //providers/Microsoft.Management/subscriptions/aca96f2e-569b-47c5-ac1d-1aff644762b5//providers/Microsoft.Authorization/roleEligibilityScheduleRequests/ecaf853d-a5ad-469c-8635-844808fbd254?api-version=2020-10-01-preview
DEBUG: HeaderParametersAdded:
DEBUG: BodyContentSet:
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com//providers/Microsoft.Management/subscriptions/aca96f2e-569b-47c5-ac1d-1aff644762b5//providers/Microsoft.Authorization/roleEligibilityScheduleRequests/ecaf853d-a5ad-469c-8635-844808fbd254?api-version=2020-10-01-preview

Headers:
x-ms-unique-id                : 3
x-ms-client-request-id        : 18d98969-3ed5-41d7-8b1b-7a2f2dccfb3d
CommandName                   : New-AzRoleEligibilityScheduleRequest
FullCommandName               : New-AzRoleEligibilityScheduleRequest_CreateExpanded
ParameterSetName              : __AllParameterSets
User-Agent                    : AzurePowershell/v9.1.0,PSVersion/v7.3.0,Az.Authorization/6.5.0

Body:
{}


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

Status Code:
NotFound

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-failure-cause            : gateway
x-ms-ratelimit-remaining-tenant-writes: 1199
x-ms-request-id               : c84bbe79-cdcc-4b42-bcc4-b9a8ee9c7838
x-ms-correlation-request-id   : c84bbe79-cdcc-4b42-bcc4-b9a8ee9c7838
x-ms-routing-request-id       : NORWAYEAST:20221212T174510Z:c84bbe79-cdcc-4b42-bcc4-b9a8ee9c7838
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Date                          : Mon, 12 Dec 2022 17:45:09 GMT

Body:
{
  "error": {
    "code": "InvalidResourceType",
    "message": "The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'."
  }
}


DEBUG: ResponseCreated:
DEBUG: BeforeResp

Environment data

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

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.10.4                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     6.5.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}

Error output

Message        : [InvalidResourceType] : The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.
StackTrace     :
Exception      : System.Exception
InvocationInfo : {New-AzRoleEligibilityScheduleRequest_CreateExpanded}
Line           : New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
Position       : At line:1 char:1
                 + New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 14
@NikolaiKleppe NikolaiKleppe added needs-triage This is a new issue that needs to be triaged to the appropriate team. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Dec 12, 2022
@ghost ghost added customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Dec 12, 2022
@RakeshMohanMSFT RakeshMohanMSFT self-assigned this Dec 13, 2022
@RakeshMohanMSFT RakeshMohanMSFT added the CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. label Dec 13, 2022
@ghost
Copy link

ghost commented Dec 13, 2022

Thank you for your feedback. This has been routed to the support team for assistance.

@RakeshMohanMSFT RakeshMohanMSFT added the Resource Authorization AzRole* in Az.Resources label Dec 13, 2022
@RakeshMohanMSFT
Copy link
Contributor

@NikolaiKleppe Thank you for reaching out, we are looking into it.

@RakeshMohanMSFT RakeshMohanMSFT removed their assignment Dec 13, 2022
@RakeshMohanMSFT RakeshMohanMSFT added Service Attention This issue is responsible by Azure service team. and removed CXP Attention [Deprecated] The Azure CXP Support Team is responsible for this issue. labels Dec 13, 2022
@ghost
Copy link

ghost commented Dec 13, 2022

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @darshanhs90, @AshishGargMicrosoft.

Issue Details

Description

Running the command:
New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope

Produces this error:
The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.

It also displays a "_CreateExpanded" suffix which I don't really understand, but might not be the reason for this error?

New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
New-AzRoleEligibilityScheduleRequest_CreateExpanded: The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.

Same with Get-AzRoleEligibilityScheduleRequest.
Happens with both required input only and full example from the docs

Am I missing some resource provider or updates?

Tried locally (Windows), Azure Cloud Shell, Azure DevOps with Linux agent using pwsh

I'll post two examples:

Azure Cloud Shell:

$guid = New-Guid    
$scope = "/providers/Microsoft.Management/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/"
New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
New-AzRoleEligibilityScheduleRequest_CreateExpanded: The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.
$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.3.0
PSEdition                      Core
GitCommitId                    7.3.0
OS                             Linux 5.4.0-1098-azure #104~18.04.2-Ubuntu SMP Tue Nov 29 12:13:35 UTC 2022
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Get-Module Az*                                                             

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.10.4                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     5.2.0                 Az.Compute                          {Add-AzImageDataDisk, Add-AzVhd, Add-AzVMAdditionalUnattendContent, Add-AzVMDataDisk…}
Script     5.2.0                 Az.Network                          {Add-AzApplicationGatewayAuthenticationCertificate, Add-AzApplicationGatewayBackendAddressPool, Add-AzApplicationGatewayBackendHttpSetting, Add-AzApplicationGa…
Script     6.5.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}
Script     5.2.0                 Az.Storage                          {Add-AzRmStorageContainerLegalHold, Add-AzStorageAccountManagementPolicyAction, Add-AzStorageAccountNetworkRule, Close-AzStorageFileHandle…}
Script     0.0.0.10              AzureAD.Standard.Preview            {Add-AzureADApplicationOwner, Add-AzureADDeviceRegisteredOwner, Add-AzureADDeviceRegisteredUser, Add-AzureADDirectoryRoleMember…}
Script     0.9.3                 AzurePSDrive 
Get-AzResourceProvider -ProviderNamespace 'Microsoft.Management'

ProviderNamespace : Microsoft.Management
RegistrationState : Registered
ResourceTypes     : {resources}
Locations         : {}
<....>

Locally on Windows

New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
New-AzRoleEligibilityScheduleRequest_CreateExpanded: The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.
$PSVersionTable

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

Script or Debug output

New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
DEBUG: [CmdletBeginProcessing]: Starting command
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: //providers/Microsoft.Management/subscriptions/aca96f2e-569b-47c5-ac1d-1aff644762b5//providers/Microsoft.Authorization/roleEligibilityScheduleRequests/ecaf853d-a5ad-469c-8635-844808fbd254?api-version=2020-10-01-preview
DEBUG: RequestCreated: //providers/Microsoft.Management/subscriptions/aca96f2e-569b-47c5-ac1d-1aff644762b5//providers/Microsoft.Authorization/roleEligibilityScheduleRequests/ecaf853d-a5ad-469c-8635-844808fbd254?api-version=2020-10-01-preview
DEBUG: HeaderParametersAdded:
DEBUG: BodyContentSet:
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
PUT

Absolute Uri:
https://management.azure.com//providers/Microsoft.Management/subscriptions/aca96f2e-569b-47c5-ac1d-1aff644762b5//providers/Microsoft.Authorization/roleEligibilityScheduleRequests/ecaf853d-a5ad-469c-8635-844808fbd254?api-version=2020-10-01-preview

Headers:
x-ms-unique-id                : 3
x-ms-client-request-id        : 18d98969-3ed5-41d7-8b1b-7a2f2dccfb3d
CommandName                   : New-AzRoleEligibilityScheduleRequest
FullCommandName               : New-AzRoleEligibilityScheduleRequest_CreateExpanded
ParameterSetName              : __AllParameterSets
User-Agent                    : AzurePowershell/v9.1.0,PSVersion/v7.3.0,Az.Authorization/6.5.0

Body:
{}


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

Status Code:
NotFound

Headers:
Cache-Control                 : no-cache
Pragma                        : no-cache
x-ms-failure-cause            : gateway
x-ms-ratelimit-remaining-tenant-writes: 1199
x-ms-request-id               : c84bbe79-cdcc-4b42-bcc4-b9a8ee9c7838
x-ms-correlation-request-id   : c84bbe79-cdcc-4b42-bcc4-b9a8ee9c7838
x-ms-routing-request-id       : NORWAYEAST:20221212T174510Z:c84bbe79-cdcc-4b42-bcc4-b9a8ee9c7838
Strict-Transport-Security     : max-age=31536000; includeSubDomains
X-Content-Type-Options        : nosniff
Date                          : Mon, 12 Dec 2022 17:45:09 GMT

Body:
{
  "error": {
    "code": "InvalidResourceType",
    "message": "The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'."
  }
}


DEBUG: ResponseCreated:
DEBUG: BeforeResp

Environment data

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

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     2.10.4                Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     6.5.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDeployment…}

Error output

Message        : [InvalidResourceType] : The resource type could not be found in the namespace 'Microsoft.Management' for api version '2020-10-01-preview'.
StackTrace     :
Exception      : System.Exception
InvocationInfo : {New-AzRoleEligibilityScheduleRequest_CreateExpanded}
Line           : New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
Position       : At line:1 char:1
                 + New-AzRoleEligibilityScheduleRequest -Name $guid -Scope $scope
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 14
Author: NikolaiKleppe
Assignees: -
Labels:

Resource Authorization, Service Attention, question, customer-reported

Milestone: -

@RakeshMohanMSFT
Copy link
Contributor

@darshanhs90 , @AshishGargMicrosoft Can you please help us look into this issue?

@dingmeng-xue
Copy link
Member

My feeling is /providers/Microsoft.Management/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/ is not correct scope. @NikolaiKleppe , could you share where you get that scope?

@NikolaiKleppe
Copy link
Author

Yea you're right @dingmeng-xue that scope is invalid, not quite sure how I ended up with Microsoft.Management there actually.

The reason I made this issue was because I (or so I thought) tested both the examples from the documentation and my own scope and got errors both times, but I must have done something wrong along the way then.

I changed scope back to just "/subscriptions/38ab2ccc-3747-4567-b36b-9478f5602f0d/" and then it worked

In hindsight it now makes more sense as to why it complained about The resource type could not be found in the namespace 'Microsoft.Management'

I'll close the issue then, thanks for the follow up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Resource Authorization AzRole* in Az.Resources Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

3 participants