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

Fix azure_compute_virtual_machine table to correctly populate guest_configuration_assignments column across all Azure environments. Closes #812 #816

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Aug 5, 2024

Integration test logs

Logs
Add passing integration test logs here

Example query results

Results
Gov Cloud:

> select name, jsonb_pretty(guest_configuration_assignments) from azure_compute_virtual_machine
Warning: Server enforces maximum TTL of 300 seconds. Cannot set TTL to 900 seconds. TTL set to 300 seconds.
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
| name               | jsonb_pretty                                                                                                                                                                                                        >
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
| test-delete-gov-vm | [                                                                                                                                                                                                                   >
|                    |     {                                                                                                                                                                                                               >
|                    |         "ID": "/subscriptions/********-****-****-****-************/resourceGroups/turbot_rg/providers/Microsoft.Compute/virtualMachines/test-delete-gov-vm/providers/Microsoft.GuestConfiguration/guestConfiguration>
|                    |         "Name": "Test6663",                                                                                                                                                                                         >
|                    |         "Type": null,                                                                                                                                                                                               >
|                    |         "Location": "usgovarizona",                                                                                                                                                                                 >
|                    |         "Properties": {                                                                                                                                                                                             >
|                    |             "context": "Policy",                                                                                                                                                                                    >
|                    |             "parameterHash": "",                                                                                                                                                                                    >
|                    |             "complianceStatus": "Pending",                                                                                                                                                                          >
|                    |             "guestConfiguration": {                                                                                                                                                                                 >
|                    |                 "kind": "Machine Configuration",                                                                                                                                                                    >
|                    |                 "name": "Test6663",                                                                                                                                                                                 >
|                    |                 "version": "1.0.0.0",                                                                                                                                                                               >
|                    |                 "contentUri": "",                                                                                                                                                                                   >
|                    |                 "contentHash": "",                                                                                                                                                                                  >
|                    |                 "contentType": "Builtin",                                                                                                                                                                           >
|                    |                 "assignmentType": "Audit",                                                                                                                                                                          >
|                    |                 "configurationSetting": {                                                                                                                                                                           >
|                    |                     "rebootIfNeeded": true,                                                                                                                                                                         >
|                    |                     "actionAfterReboot": "",                                                                                                                                                                        >
|                    |                     "configurationMode": "MonitorOnly",                                                                                                                                                             >
|                    |                     "allowModuleOverwrite": false,                                                                                                                                                                  >
|                    |                     "refreshFrequencyMins": 5,                                                                                                                                                                      >
|                    |                     "configurationModeFrequencyMins": 15                                                                                                                                                            >
|                    |                 },                                                                                                                                                                                                  >
|                    |                 "configurationParameter": [                                                                                                                                                                         >
|                    |                 ],                                                                                                                                                                                                  >
|                    |                 "configurationProtectedParameter": [                                                                                                                                                                >
|                    |                 ]                                                                                                                                                                                                   >
|                    |             }                                                                                                                                                                                                       >
|                    |         },                                                                                                                                                                                                          >
|                    |         "SystemData": null                                                                                                                                                                                          >
|                    |     }                                                                                                                                                                                                               >
|                    | ]                                                                                                                                                                                                                   >
+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

Time: 7.2s. Rows returned: 1. Rows fetched: 1. Hydrate calls: 1.

Scans:
  1) azure_compute_virtual_machine.azure: Time: 7.1s. Fetched: 1. Hydrates: 1.


Commercial Cloud:

> select name, jsonb_pretty(guest_configuration_assignments) from azure_via_sp_secret.azure_compute_virtual_machine
+----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
| name           | jsonb_pretty                                                                                                                                                                                                            >
+----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
| turbottest7905 | <null>                                                                                                                                                                                                                  >
| testvm-123     | [                                                                                                                                                                                                                       >
|                |     {                                                                                                                                                                                                                   >
|                |         "ID": "/subscriptions/********-****-****-****-************/resourceGroups/turbottest7905/providers/Microsoft.Compute/virtualMachines/testvm-123/providers/Microsoft.GuestConfiguration/guestConfigurationAssignm>
|                |         "Name": "GuestAssignment2",                                                                                                                                                                                     >
|                |         "Type": null,                                                                                                                                                                                                   >
|                |         "Location": "westcentralus",                                                                                                                                                                                    >
|                |         "Properties": {                                                                                                                                                                                                 >
|                |             "context": "Policy",                                                                                                                                                                                        >
|                |             "parameterHash": "",                                                                                                                                                                                        >
|                |             "complianceStatus": "Pending",                                                                                                                                                                              >
|                |             "guestConfiguration": {                                                                                                                                                                                     >
|                |                 "kind": "Machine Configuration",                                                                                                                                                                        >
|                |                 "name": "Guest Configuration extension should be installed on your machines",                                                                                                                           >
|                |                 "version": "1.0.0.3",                                                                                                                                                                                   >
|                |                 "contentType": "Builtin",                                                                                                                                                                               >
|                |                 "assignmentSource": "Manual assignment",                                                                                                                                                                >
|                |                 "configurationSetting": {                                                                                                                                                                               >
|                |                     "rebootIfNeeded": true,                                                                                                                                                                             >
|                |                     "actionAfterReboot": "",                                                                                                                                                                            >
|                |                     "configurationMode": "MonitorOnly",                                                                                                                                                                 >
|                |                     "allowModuleOverwrite": false,                                                                                                                                                                      >
|                |                     "refreshFrequencyMins": 5,                                                                                                                                                                          >
|                |                     "configurationModeFrequencyMins": 15                                                                                                                                                                >
|                |                 },                                                                                                                                                                                                      >
|                |                 "configurationParameter": [                                                                                                                                                                             >
|                |                 ],                                                                                                                                                                                                      >
|                |                 "configurationProtectedParameter": [                                                                                                                                                                    >
|                |                 ]                                                                                                                                                                                                       >
|                |             }                                                                                                                                                                                                           >
|                |         },                                                                                                                                                                                                              >
|                |         "SystemData": null                                                                                                                                                                                              >
|                |     }                                                                                                                                                                                                                   >
|                | ]                                                                                                                                                                                                                       >
+----------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->

…onfiguration_assignments column across all Azure environments. Closes #812
@misraved misraved merged commit f9eeea5 into main Aug 7, 2024
1 check passed
@misraved misraved deleted the issue-812 branch August 7, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compatibility Issue in Azure Plugin Due to API Version Update for Azure Government Environments
2 participants