Azure / Azure/azure-powershell
Unable to run the cmdlet of Az.DedicatedHsm
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 51
Description
### Description
Unable to run all cmdlets of Az.DedicatedHsm Module.
All of them will warn that the resource type could not be found
### Issue script & Debug output
```PowerShell
DEBUG: ============================ HTTP REQUEST ============================
HTTP Method:
PUT
Absolute Uri:
https://management.azure.com/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272f09590/resourceGroups/yufan-rg/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/yufan-hsm?api-version=2018-10-31
Headers:
x-ms-unique-id : 5
x-ms-client-request-id : 1b924cda-a0f8-4f21-9865-ae4892423ff7
CommandName : New-AzDedicatedHsm
FullCommandName : New-AzDedicatedHsm_CreateExpanded
ParameterSetName : __AllParameterSets
User-Agent : AzurePowershell/v0.0.0,Az.DedicatedHsm/0.2.0
Body:
{
"sku": {
"name": "SafeNet Luna Network HSM A790"
},
"location": "eastus",
"properties": {
"networkProfile": {
"subnet": {
"id": "/subscriptions/xxxx-xxxx-xxx-xxx/resourceGroups/dedicatedhsm-rg-n359cz/providers/Microsoft.Network/virtualNetworks/vnetq30la9/subnets/hsmsubnet"
},
"networkInterfaces": [
{
"privateIpAddress": "10.2.1.120"
}
]
},
"stampId": "stamp1"
}
}
DEBUG: BeforeCall:
DEBUG: ============================ HTTP RESPONSE ============================
Status Code:
NotFound
Headers:
Cache-Control : no-cache
Pragma : no-cache
x-ms-failure-cause : gateway
x-ms-request-id : 202716b3-63c1-490e-8423-4a025e0c4ffd
x-ms-correlation-request-id : 202716b3-63c1-490e-8423-4a025e0c4ffd
x-ms-routing-request-id : SOUTHEASTASIA:20220112T064642Z:202716b3-63c1-490e-8423-4a025e0c4ffd
Strict-Transport-Security : max-age=31536000; includeSubDomains
X-Content-Type-Options : nosniff
Date : Wed, 12 Jan 2022 06:46:41 GMT
Body:
{
"error": {
"code": "InvalidResourceType",
"message": "The resource type could not be found in the namespace 'Microsoft.HardwareSecurityModules' for api version '2018-10-31'."
}
}
DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
New-AzDedicatedHsm_CreateExpanded: The resource type could not be found in the namespace 'Microsoft.HardwareSecurityModules' for api version '2018-10-31'.
DEBUG: [Finally]: Getting exception 'Microsoft.Azure.Commands.Common.Exceptions.AzPSResourceNotFoundCloudException: InternalException' from response
```
### Environment data
```PowerShell
Name Value
---- -----
PSVersion 7.2.0-preview.10
PSEdition Core
GitCommitId 7.2.0-preview.10
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
```PowerShell
Version Name Repository Description
------- ---- ---------- -----------
0.2.0 Az.DedicatedHsm PSGallery Microsoft Azure PowerShell: DedicatedHsm…
```
### Error output
```PowerShell
Message : [InvalidResourceType] : The resource type could not be found in the namespace
'Microsoft.HardwareSecurityModules' for api version '2018-10-31'.
StackTrace :
Exception : System.Exception
InvocationInfo : {New-AzDedicatedHsm_CreateExpanded}
Line : New-AzDedicatedHsm -Name yufan-hsm -ResourceGroupName yufan-rg -Location eastus -Sku "SafeNet Luna
Network HSM A790" -StampId stamp1 -SubnetId "/subscriptions/xxxx-xxxx-xxx-xxx/resourceGroups/dedicated
hsm-rg-n359cz/providers/Microsoft.Network/virtualNetworks/vnetq30la9/subnets/hsmsubnet"
-NetworkInterface @{PrivateIPAddress = '10.2.1.120' }
Position : At line:1 char:1
+ New-AzDedicatedHsm -Name yufan-hsm -ResourceGroupName yufan-rg -Loca …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId : 13
```
Contributor guide
Research direction
Start by reproducing New-AzDedicatedHsm with Az.DedicatedHsm 0.2.0 and inspect the request to Microsoft.HardwareSecurityModules using api-version 2018-10-31. Verify whether the provider, resource type, and API version are available for the subscription and region; done means the DedicatedHsm cmdlets no longer return InvalidResourceType.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100