internal static Certificate[] GetCertificates(ResourceClient resourceClient, WebsitesClient websitesClient, string resourceGroupName, string thumbPrint) { var certificateResources = resourceClient.ResourceManagementClient.FilterResources(new FilterResourcesOptions { ResourceGroup = resourceGroupName, ResourceType = "Microsoft.Web/Certificates" }).ToArray(); var certificates = certificateResources.Select( certificateResource => websitesClient.GetCertificate(certificateResource.ResourceGroupName ?? GetResourceGroupFromResourceId(certificateResource.Id), certificateResource.Name)); if (!string.IsNullOrEmpty(thumbPrint)) { certificates = certificates.Where(c => string.Equals(c.Thumbprint, thumbPrint, StringComparison.OrdinalIgnoreCase)).ToList(); } return(certificates.ToArray()); }
internal static Certificate[] GetCertificates(ResourcesClient resourceClient, WebsitesClient websitesClient, string resourceGroupName, string thumbPrint) { var certificateResources = resourceClient.FilterPSResources(new BasePSResourceParameters() { ResourceType = "Microsoft.Web/Certificates" }).ToArray(); if (!string.IsNullOrEmpty(resourceGroupName)) { certificateResources = certificateResources.Where(c => string.Equals(c.ResourceGroupName, resourceGroupName, StringComparison.OrdinalIgnoreCase)).ToArray(); } var certificates = certificateResources.Select( certificateResource => websitesClient.GetCertificate(certificateResource.ResourceGroupName, certificateResource.Name)); if (!string.IsNullOrEmpty(thumbPrint)) { certificates = certificates.Where(c => string.Equals(c.Thumbprint, thumbPrint, StringComparison.OrdinalIgnoreCase)).ToList(); } return(certificates.ToArray()); }
internal static Certificate[] GetCertificates(ResourcesClient resourceClient, WebsitesClient websitesClient, string resourceGroupName, string thumbPrint) { var certificateResources = resourceClient.FilterPSResources(new BasePSResourceParameters() { ResourceType = "Microsoft.Web/Certificates" }).ToArray(); if (!string.IsNullOrEmpty(resourceGroupName)) { certificateResources = certificateResources.Where(c => string.Equals(c.ResourceGroupName, resourceGroupName, StringComparison.OrdinalIgnoreCase)).ToArray(); } var certificates = certificateResources.Select( certificateResource => websitesClient.GetCertificate(certificateResource.ResourceGroupName, certificateResource.Name)); if (!string.IsNullOrEmpty(thumbPrint)) { certificates = certificates.Where(c => string.Equals(c.Thumbprint, thumbPrint, StringComparison.OrdinalIgnoreCase)).ToList(); } return certificates.ToArray(); }