Skip to content

Commit a9d0f28

Browse files
author
Maddie Clayton
authored
Merge pull request #7820 from yaakoviyun/preview
Removed storage depedency when inferring storageBlobContainerName
2 parents 07ea15e + 87ffded commit a9d0f28

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/ResourceManager/Sql/Commands.Sql/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
- Additional information about change #1
1919
-->
2020
## Current Release
21+
* Fixed issue with using Get-AzureRmSqlDatabaseVulnerabilityAssessment with DotNet core
2122

2223
## Version 4.12.0
2324
* Added new cmdlets for CRUD operations on Azure Sql Database Managed Instance and Azure Sql Managed Database

src/ResourceManager/Sql/Commands.Sql/VulnerabilityAssessment/Services/BaseSqlVulnerabilityAssessmentAdapter.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,14 @@ public DatabaseVulnerabilityAssessmentSettingsModel ConvertSettingsToModel(strin
8484
string storageBlobContainerName = string.Empty;
8585
if (!string.IsNullOrEmpty(settings.StorageContainerPath))
8686
{
87+
// StorageContainerPath is in the format of : "https://va1storage.blob.core.windows.net/vulnerability-assessment"
8788
string storageAccountNamePart = settings.StorageContainerPath.Split(new string[] { "https://" }, StringSplitOptions.RemoveEmptyEntries)[0];
8889
if (!string.IsNullOrEmpty(storageAccountNamePart))
8990
{
9091
storageAccountName = storageAccountNamePart.Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries)[0];
9192
}
9293

93-
#if!NETSTANDARD
94-
CloudBlob cloudBlob = new CloudBlob(new Uri(settings.StorageContainerPath));
95-
storageBlobContainerName = cloudBlob.Container.Name;
96-
#endif
94+
storageBlobContainerName = settings.StorageContainerPath.Split(new string[] { "/" }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault();
9795
}
9896

9997
var databaseVulnerabilityAssessmentSettingsModel = new DatabaseVulnerabilityAssessmentSettingsModel

0 commit comments

Comments
 (0)