Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Adding more validators to the new connection string validator endpoint #14

Conversation

sidkri
Copy link
Member

@sidkri sidkri commented Aug 16, 2021

The following connections strings are supported with this PR:

  1. Storage
  2. Service Bus
  3. Event Hubs

Minor refactor of IsValid to be an async function for consistency and incase future validators call async methods (async all the way)

@sidkri sidkri requested a review from yifguoMSFT August 16, 2021 06:41
@@ -364,6 +445,9 @@
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
<Import Project="..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.3\build\Microsoft.Azure.Services.AppAuthentication.targets" Condition="Exists('..\packages\Microsoft.Azure.Services.AppAuthentication.1.0.3\build\Microsoft.Azure.Services.AppAuthentication.targets')" />
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -9,7 +9,7 @@ namespace DiagnosticsExtension.Models.ConnectionStringValidator
interface IConnectionStringValidator
{
// verify provided string is a valid connection string that can be tested by the validator
bool IsValid(string connStr);
Task<bool> IsValid(string connStr);
Copy link
Member Author

Choose a reason for hiding this comment

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

Rename to IsValidAsync

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

CloudBlobClient client = storageAccount.CreateCloudBlobClient();
client.GetServiceProperties();
IEnumerable<CloudBlobContainer> containers = client.ListContainers();
if (containers.Count() == 0)
Copy link
Member Author

Choose a reason for hiding this comment

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

Remove this if statement

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@sidkri sidkri merged commit 3720791 into feature/connection-string-validation Aug 18, 2021
@sidkri sidkri deleted the sidkri/service-bus-event-hubs-validators branch August 18, 2021 08:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants