Skip to content

Conversation

@strickvl
Copy link
Contributor

We added the Azure Secrets Manager integration and updated docs as appropriate.

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • If my change requires a change to docs, I have updated the documentation accordingly.
  • If I have added an integration, I have updated the integrations table.
  • I have added tests to cover my changes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

@strickvl strickvl added enhancement New feature or request internal To filter out internal PRs and issues labels May 27, 2022
Copy link
Contributor

@safoinme safoinme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 Let's Go Azure Secrets manager

secret_name: the name of the secret to delete"""
self._ensure_client_connected(self.key_vault_name)

# Go through all GCP secrets and delete the ones with the secret_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a typing comment

# Go through all Azure secrets and delete the ones with the secret_name

Copy link
Contributor

@AlexejPenner AlexejPenner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remembered one small topic that we might need to adress somewhere

@strickvl strickvl removed the request for review from stefannica May 30, 2022 09:51
Copy link
Contributor

@htahir1 htahir1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a few comments. Otherwise looks great! 💯


for secret_property in self.CLIENT.list_properties_of_secrets():
response = self.CLIENT.get_secret(secret_property.name)
tags = response.properties.tags
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it ensured that properties will exist?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, but that's why we have the check on the next line. It's either a list, or None.


secret_contents[secret_key] = response.value

zenml_schema_name = response.properties.tags.get(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this can be just tags. ?

if not secret_contents:
raise RuntimeError(f"No secrets found within the {secret_name}")

secret_contents["name"] = secret_name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the key name already exists here? Is it possible?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's currently possible, but I've just added a check for that in the CLI.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still throw an exception here if it somehow exists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

secret_property.name,
tags.get(ZENML_GROUP_KEY),
)
self.CLIENT.begin_delete_secret(secret_property.name).result()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does .result() do. Should we capture it and log it out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method returns a 'poller' (see docs). This would be useful for us if we wanted to wait until we'd confirmed that the deletion process had completed. But we decided that for our CLI this isn't important and we don't need to wait after making this call.

@strickvl strickvl requested a review from htahir1 May 31, 2022 15:27
parsed_args = parse_unknown_options(args, expand_args=True)
except AssertionError as e:
error(str(e))
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this return intentionally taken out?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The error raises an exception already, so it's a redundant return. I know elsewhere in the codebase we've been removing these redundant returns so I saw it here and removed it.

@strickvl strickvl requested a review from htahir1 June 1, 2022 08:03
@strickvl strickvl merged commit 8bddedb into develop Jun 1, 2022
@strickvl strickvl deleted the feature/ENG-900-azure-secrets-manager branch June 1, 2022 08:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request internal To filter out internal PRs and issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants