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

Bug: azure_servicebus_namespace table breaks if encryption is set for servicebus namespace #332

Closed
khushboo9024 opened this issue Sep 23, 2021 · 2 comments · Fixed by #366
Assignees
Labels
bug Something isn't working

Comments

@khushboo9024
Copy link
Contributor

Describe the bug
azure_servicebus_namespace breaks with below error if encryption is set for servicebus namespace

> select * from azure_servicebus_namespace where name = 'tts0premiunm' and resource_group = 'hipaa-hitrust'
Error: servicebus.NamespacesClient#Get: Failure responding to request: StatusCode=200 -- Original Error: Error occurred unmarshalling JSON - Error = 'json: cannot unmarshal array into Go struct field Encryption.encryption.keyVaultProperties of type servicebus.KeyVaultProperties' JSON = '{"sku":{"name":"Premium","tier":"Premium","capacity":1},"id":"/subscriptions/xxxxxxxxxxxxx/resourceGroups/hipaa-hitrust/providers/Microsoft.ServiceBus/namespaces/tts0premiunm","name":"tts0premiunm","type":"Microsoft.ServiceBus/Namespaces","location":"West US 2","tags":{},"identity":{"principalId":"dccc7799-e6b8-4ad7-9b4a-3e75e3cf82ee","tenantId":"cdffd708-7da0-4cea-abeb-0a4c334d7f64","type":"SystemAssigned"},"properties":{"zoneRedundant":true,"encryption":{"keySource":"Microsoft.KeyVault","keyVaultProperties":[{"keyName":"tess","keyVaultUri":"https://tets56.vault.azure.net","keyVersion":""}],"requireInfrastructureEncryption":false},"provisioningState":"Succeeded","metricId":"xxxxxxxxxxxxx:tts0premiunm","createdAt":"2021-09-23T10:06:26.503Z","updatedAt":"2021-09-23T10:09:37.25Z","serviceBusEndpoint":"https://tts0premiunm.servicebus.windows.net:443/","status":"Active"}}

Steampipe version (steampipe -v)
Example: v0.3.0

Plugin version (steampipe plugin list)
Example: v0.5.0

To reproduce
Create a servicebus namespace with encryption enabled with CMK

Expected behavior
A clear and concise description of what you expected to happen.

Additional context
Add any other context about the problem here.

@khushboo9024 khushboo9024 added the bug Something isn't working label Sep 23, 2021
@c0d3r-arnab c0d3r-arnab assigned c0d3r-arnab and unassigned ParthaI Sep 24, 2021
@c0d3r-arnab
Copy link
Contributor

The keyVaultProperties from the API response is in array format like the following:

{ "keySource": "Microsoft.KeyVault", "keyVaultProperties": [ { "keyName": "test-key", "keyVaultUri": "https://testing-service-bus-1.vault.azure.net", "keyVersion": "" } ], "requireInfrastructureEncryption": false }

However, the SDK has keyVaultProperties in object structure like the following:

type Encryption struct { KeyVaultProperties *KeyVaultProperties KeySource KeySource }

As a result, JSON unmarshal is failing. We will need to raise a ticket in SDK to address the issue.

@c0d3r-arnab c0d3r-arnab added the blocked Work on this issue is currently blocked label Sep 24, 2021
@bigdatasourav
Copy link
Contributor

issue Azure/azure-sdk-for-go#15652 has been raised in azure go sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
4 participants