/// <summary> /// Given a publish settings files - adds a management certificate to the request /// </summary> IDeploymentActivity ICertificateActivity.AddPublishSettingsFromFile(string path) { var settings = new PublishSettingsExtractor(path); ManagementCertificate = settings.AddPublishSettingsToPersonalMachineStore(); return(this); }
public void TestGetCertificateThumbprint() { var cert = PublishSettingsExtractor.AddPublishSettingsToPersonalMachineStore(Publishsettings); var settings = new PublishSettingsExtractor(_fullFileName); string thumbprint = settings.GetCertificateThumbprint(); thumbprint.Should().NotBeNullOrEmpty("Contains a thumbprint from the given file"); thumbprint.Should().Be(cert.Thumbprint, "The same as the parsed certificate value"); PublishSettingsExtractor.RemoveFromStore(cert.Thumbprint); }
public void TestAddCertificateToStoreFromPublishSettings() { var cert = PublishSettingsExtractor.AddPublishSettingsToPersonalMachineStore(Publishsettings); cert.Should().NotBeNull("Contains a ASN1/DER encoded certificate"); cert.HasPrivateKey.Should().BeTrue("Contains a PKCS#12 structure"); var cert2 = PublishSettingsExtractor.FromStore(cert.Thumbprint); cert2.Thumbprint.Should().Be(cert.Thumbprint, "The same certificate"); cert2.HasPrivateKey.Should().BeTrue("Same certificate as above should exist and be imported with pvk into the personal store"); PublishSettingsExtractor.RemoveFromStore(cert2.Thumbprint); }
// check to see whether there is a management certificate and use it in the service management call private void EnsureManagementCertificate() { // get the management certificate first of all if (ManagementCertificate == null) { if (String.IsNullOrEmpty(PublishSettingsFile) && String.IsNullOrEmpty(SubscriptionId)) { throw new ApplicationException("Unable to find publishsettings files or subscription id is empty"); } var settings = new PublishSettingsExtractor(PublishSettingsFile); ManagementCertificate = settings.AddPublishSettingsToPersonalMachineStore(); } }
/// <summary> /// Adds a .publishsettings profile from a given body of Xml /// </summary> IVirtualMachineActivity ICertificateActivity.AddPublishSettingsFromXml(string xml) { Properties.Certificate = PublishSettingsExtractor.AddPublishSettingsToPersonalMachineStore(xml); return(this); }
/// <summary> /// Given a publish settings files - adds a management certificate to the request /// </summary> IDeploymentActivity ICertificateActivity.AddPublishSettingsFromFile(string path) { var settings = new PublishSettingsExtractor(path); ManagementCertificate = settings.AddPublishSettingsToPersonalMachineStore(); return this; }
private X509Certificate2 GetCertificateFromPublishSettings(string publishSettings) { var settings = new PublishSettingsExtractor(publishSettings); return(settings.AddPublishSettingsToPersonalMachineStore()); }
public void PostProcess() { var extractor = new PublishSettingsExtractor(PublishSettings); var client = new StorageClient(SubscriptionId, extractor.AddPublishSettingsToPersonalMachineStore()); var keys = client.GetStorageAccountKeys(StorageName); ConnectionString = String.Format("DefaultEndpointsProtocol=https;AccountName={0};AccountKey={1}", StorageName, keys[0]); // put a container create process here - add this method to fluent!!! var blobClient = new BlobClient(SubscriptionId, "packages", StorageName, keys[0]); blobClient.CreatBlobContainer(); }