/// <summary> /// This method is responsible to call the right API in the communication layer that will eventually send the information in the /// object to the REST endpoint /// </summary> /// <param name="model">The model object with the data to be sent to the REST endpoints</param> protected override DatabaseVulnerabilityAssessmentSettingsModel PersistChanges(DatabaseVulnerabilityAssessmentSettingsModel model) { string storageContainerPath = ""; string storageAccountSasKey = ""; if (ParameterSetName == UpdateSettingsWithBlobStorageSasUri) { // In this case the user provided a full BlobStorageSasUri (e.g. "https://mystorage.blob.core.windows.net/vulnerability-assessment?st=XXXXXX" ) var storageContainerArgs = BlobStorageSasUri.AbsoluteUri.ToString().Split('?'); storageContainerPath = storageContainerArgs[0]; storageAccountSasKey = storageContainerArgs[1]; } else { // SetSettingsWithStorageAccountNameParameterSet and SetByInputObjectParameterSet StorageContainerInfo storageContainerInfo = ModelAdapter.CreateBlobStorageContainerAndSAS(model.StorageAccountName, model.ScanResultsContainerName).GetAwaiter().GetResult(); storageContainerPath = storageContainerInfo.StorageContainerPath; storageAccountSasKey = storageContainerInfo.StorageAccountSasKey; } return(ModelAdapter.SetDatabaseVulnerabilityAssessmentSettings(model, storageContainerPath, storageAccountSasKey)); }