diff --git a/internal/services/machinelearning/machine_learning_datastore_fileshare_resource.go b/internal/services/machinelearning/machine_learning_datastore_fileshare_resource.go index fcf9586abdec..7fa440f094c2 100644 --- a/internal/services/machinelearning/machine_learning_datastore_fileshare_resource.go +++ b/internal/services/machinelearning/machine_learning_datastore_fileshare_resource.go @@ -158,7 +158,7 @@ func (r MachineLearningDataStoreFileShare) Create() sdk.ResourceFunc { props := &datastore.AzureFileDatastore{ AccountName: fileShareId.StorageAccountName, - FileShareName: fileShareId.FileshareName, + FileShareName: fileShareId.ShareName, Description: utils.String(model.Description), ServiceDataAccessAuthIdentity: utils.ToPtr(datastore.ServiceDataAccessAuthIdentity(model.ServiceDataIdentity)), Tags: utils.ToPtr(model.Tags), @@ -226,7 +226,7 @@ func (r MachineLearningDataStoreFileShare) Update() sdk.ResourceFunc { props := &datastore.AzureFileDatastore{ AccountName: fileShareId.StorageAccountName, - FileShareName: fileShareId.FileshareName, + FileShareName: fileShareId.ShareName, Description: utils.String(state.Description), ServiceDataAccessAuthIdentity: utils.ToPtr(datastore.ServiceDataAccessAuthIdentity(state.ServiceDataIdentity)), Tags: utils.ToPtr(state.Tags), diff --git a/internal/services/storage/parse/storage_share_resource_manager.go b/internal/services/storage/parse/storage_share_resource_manager.go index 0c1fa05071c6..64487ddc5910 100644 --- a/internal/services/storage/parse/storage_share_resource_manager.go +++ b/internal/services/storage/parse/storage_share_resource_manager.go @@ -14,22 +14,22 @@ type StorageShareResourceManagerId struct { ResourceGroup string StorageAccountName string FileServiceName string - FileshareName string + ShareName string } -func NewStorageShareResourceManagerID(subscriptionId, resourceGroup, storageAccountName, fileServiceName, fileshareName string) StorageShareResourceManagerId { +func NewStorageShareResourceManagerID(subscriptionId, resourceGroup, storageAccountName, fileServiceName, shareName string) StorageShareResourceManagerId { return StorageShareResourceManagerId{ SubscriptionId: subscriptionId, ResourceGroup: resourceGroup, StorageAccountName: storageAccountName, FileServiceName: fileServiceName, - FileshareName: fileshareName, + ShareName: shareName, } } func (id StorageShareResourceManagerId) String() string { segments := []string{ - fmt.Sprintf("Fileshare Name %q", id.FileshareName), + fmt.Sprintf("Share Name %q", id.ShareName), fmt.Sprintf("File Service Name %q", id.FileServiceName), fmt.Sprintf("Storage Account Name %q", id.StorageAccountName), fmt.Sprintf("Resource Group %q", id.ResourceGroup), @@ -39,8 +39,8 @@ func (id StorageShareResourceManagerId) String() string { } func (id StorageShareResourceManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Storage/storageAccounts/%s/fileServices/%s/fileshares/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.StorageAccountName, id.FileServiceName, id.FileshareName) + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Storage/storageAccounts/%s/fileServices/%s/shares/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroup, id.StorageAccountName, id.FileServiceName, id.ShareName) } // StorageShareResourceManagerID parses a StorageShareResourceManager ID into an StorageShareResourceManagerId struct @@ -69,7 +69,7 @@ func StorageShareResourceManagerID(input string) (*StorageShareResourceManagerId if resourceId.FileServiceName, err = id.PopSegment("fileServices"); err != nil { return nil, err } - if resourceId.FileshareName, err = id.PopSegment("fileshares"); err != nil { + if resourceId.ShareName, err = id.PopSegment("shares"); err != nil { return nil, err } diff --git a/internal/services/storage/parse/storage_share_resource_manager_test.go b/internal/services/storage/parse/storage_share_resource_manager_test.go index 90e80db72c0a..d0ea448b1a5a 100644 --- a/internal/services/storage/parse/storage_share_resource_manager_test.go +++ b/internal/services/storage/parse/storage_share_resource_manager_test.go @@ -12,7 +12,7 @@ var _ resourceids.Id = StorageShareResourceManagerId{} func TestStorageShareResourceManagerIDFormatter(t *testing.T) { actual := NewStorageShareResourceManagerID("12345678-1234-9876-4563-123456789012", "resGroup1", "storageAccount1", "fileService1", "share1").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/fileshares/share1" + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/shares/share1" if actual != expected { t.Fatalf("Expected %q but got %q", expected, actual) } @@ -80,32 +80,32 @@ func TestStorageShareResourceManagerID(t *testing.T) { }, { - // missing FileshareName + // missing ShareName Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/", Error: true, }, { - // missing value for FileshareName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/fileshares/", + // missing value for ShareName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/shares/", Error: true, }, { // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/fileshares/share1", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/shares/share1", Expected: &StorageShareResourceManagerId{ SubscriptionId: "12345678-1234-9876-4563-123456789012", ResourceGroup: "resGroup1", StorageAccountName: "storageAccount1", FileServiceName: "fileService1", - FileshareName: "share1", + ShareName: "share1", }, }, { // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.STORAGE/STORAGEACCOUNTS/STORAGEACCOUNT1/FILESERVICES/FILESERVICE1/FILESHARES/SHARE1", + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.STORAGE/STORAGEACCOUNTS/STORAGEACCOUNT1/FILESERVICES/FILESERVICE1/SHARES/SHARE1", Error: true, }, } @@ -137,8 +137,8 @@ func TestStorageShareResourceManagerID(t *testing.T) { if actual.FileServiceName != v.Expected.FileServiceName { t.Fatalf("Expected %q but got %q for FileServiceName", v.Expected.FileServiceName, actual.FileServiceName) } - if actual.FileshareName != v.Expected.FileshareName { - t.Fatalf("Expected %q but got %q for FileshareName", v.Expected.FileshareName, actual.FileshareName) + if actual.ShareName != v.Expected.ShareName { + t.Fatalf("Expected %q but got %q for ShareName", v.Expected.ShareName, actual.ShareName) } } } diff --git a/internal/services/storage/resourceids.go b/internal/services/storage/resourceids.go index 2e2a9bb0ee2b..9b02ca380533 100644 --- a/internal/services/storage/resourceids.go +++ b/internal/services/storage/resourceids.go @@ -6,7 +6,7 @@ package storage //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageAccountDefaultBlob -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/blobServices/default //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageContainerResourceManager -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/blobServices/default/containers/container1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageQueueResourceManager -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/queueServices/default/queues/queue1 -//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageShareResourceManager -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/fileshares/share1 +//go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageShareResourceManager -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/shares/share1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageSyncGroup -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.StorageSync/storageSyncServices/storageSyncService1/syncGroups/syncGroup1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageSyncService -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.StorageSync/storageSyncServices/storageSyncService1 //go:generate go run ../../tools/generator-resource-id/main.go -path=./ -name=StorageSyncCloudEndpoint -id=/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.StorageSync/storageSyncServices/storageSyncService1/syncGroups/syncGroup1/cloudEndpoints/cloudEndpoint1 diff --git a/internal/services/storage/validate/storage_share_resource_manager_id_test.go b/internal/services/storage/validate/storage_share_resource_manager_id_test.go index a98905116075..0ed7ad134eb7 100644 --- a/internal/services/storage/validate/storage_share_resource_manager_id_test.go +++ b/internal/services/storage/validate/storage_share_resource_manager_id_test.go @@ -65,26 +65,26 @@ func TestStorageShareResourceManagerID(t *testing.T) { }, { - // missing FileshareName + // missing ShareName Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/", Valid: false, }, { - // missing value for FileshareName - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/fileshares/", + // missing value for ShareName + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/shares/", Valid: false, }, { // valid - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/fileshares/share1", + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resGroup1/providers/Microsoft.Storage/storageAccounts/storageAccount1/fileServices/fileService1/shares/share1", Valid: true, }, { // upper-cased - Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.STORAGE/STORAGEACCOUNTS/STORAGEACCOUNT1/FILESERVICES/FILESERVICE1/FILESHARES/SHARE1", + Input: "/SUBSCRIPTIONS/12345678-1234-9876-4563-123456789012/RESOURCEGROUPS/RESGROUP1/PROVIDERS/MICROSOFT.STORAGE/STORAGEACCOUNTS/STORAGEACCOUNT1/FILESERVICES/FILESERVICE1/SHARES/SHARE1", Valid: false, }, }