diff --git a/app/components/account/base/storage-account-picker/storage-account-picker.html b/app/components/account/base/storage-account-picker/storage-account-picker.html index 588602c4a7..a5238c2393 100644 --- a/app/components/account/base/storage-account-picker/storage-account-picker.html +++ b/app/components/account/base/storage-account-picker/storage-account-picker.html @@ -6,16 +6,17 @@

Storage accounts in the same region as your batch account({{account.location Name Region + No storage account - + - + {{account.isClassic ? "Classic" : ""}}
@@ -28,10 +29,13 @@

Other regions

Name Region + + + {{account.isClassic ? "Classic" : ""}}
diff --git a/app/core/record/arm-record.ts b/app/core/record/arm-record.ts index ddf8fa3f30..7a54a32bb3 100644 --- a/app/core/record/arm-record.ts +++ b/app/core/record/arm-record.ts @@ -1,13 +1,18 @@ +import { Model, Prop } from "./decorators"; import { Record } from "./record"; export interface ArmRecordAttributes { id: string; + type: string; } /** * ArmRecord is a subclass of record that unify the id for ARM record which have problems with the case. */ +@Model() export class ArmRecord extends Record { + @Prop() public type: string; + constructor(data: T) { super(Object.assign({}, data, { id: data.id && data.id.toLowerCase() })); } diff --git a/app/models/storage-account.ts b/app/models/storage-account.ts index 7d044ba729..4594430286 100644 --- a/app/models/storage-account.ts +++ b/app/models/storage-account.ts @@ -1,4 +1,4 @@ -import { ArmRecord, Model, Prop, Record } from "app/core"; +import { ArmRecord, ArmRecordAttributes, Model, Prop, Record } from "app/core"; interface StorageAccountPropertiesAttributes { creationTime: Date; @@ -27,14 +27,16 @@ class StorageAccountProperties extends Record; + type: StorageAccountType; } +export type StorageAccountType = "Microsoft.Storage/storageAccounts" | "Microsoft.ClassicStorage/storageAccounts"; + @Model() export class StorageAccount extends ArmRecord { @Prop() public id: string; @@ -46,4 +48,12 @@ export class StorageAccount extends ArmRecord { @Prop() public kind: string; @Prop() public properties: StorageAccountProperties; + + public type: StorageAccountType; + public isClassic: boolean; + + constructor(data: StorageAccountAttributes) { + super(data); + this.isClassic = this.type === "Microsoft.ClassicStorage/storageAccounts"; + } } diff --git a/app/services/storage-account.service.ts b/app/services/storage-account.service.ts index c8e22094e7..6d2fac0c4e 100644 --- a/app/services/storage-account.service.ts +++ b/app/services/storage-account.service.ts @@ -36,7 +36,9 @@ export class StorageAccountService { public list(subscriptionId: string): Observable> { const search = new URLSearchParams(); - search.set("$filter", "resourceType eq 'Microsoft.Storage/storageAccounts'"); + search.set("$filter", + "resourceType eq 'Microsoft.Storage/storageAccounts'" + + "or resourceType eq 'Microsoft.ClassicStorage/storageAccounts'"); const options = new RequestOptions({ search }); return this.subscriptionService.get(subscriptionId)