[BUG] Use PremiumLRS storage without a Storage Account.
See original GitHub issueDescribe the bug There is a bug that if you select
.WithLatestWindowsImage("MicrosoftWindowsServer", "WindowsServer", "2016-Datacenter")
then you can’t use
.WithOSDiskStorageAccountType(StorageAccountTypes.PremiumLRS)
The only way around it, is add to a storage account by doing this:
.WithNewStorageAccount(storageAccount)
However, if i change the .WithLatestWindowsImage("MicrosoftWindowsServer", "WindowsServer", "2016-Datacenter")
to .WithPopularLinuxImage(KnownLinuxVirtualMachineImage.UbuntuServer14_04_Lts)
then i don’t need to use a storage account and it works great!
Exception or Stack Trace N/A
To Reproduce Steps to reproduce the behavior:
Example in code snippet below.
Code Snippet Add the code snippet that causes the issue.
azure.VirtualMachines .Define(vmName) .WithRegion(location) .WithExistingResourceGroup(rgName) .WithExistingPrimaryNetworkInterface(networkInterface) .WithLatestWindowsImage("MicrosoftWindowsServer", "WindowsServer", "2016-Datacenter") .WithAdminUsername("azureuser") .WithAdminPassword("#####") .WithComputerName(vmName) .WithSize(vmSize) .WithOSDiskName(vmName + "-osdisk") .WithTag("Environment", "Dev") .WithOSDiskStorageAccountType(StorageAccountTypes.PremiumLRS) .WithOSDiskCaching(CachingTypes.ReadWrite) .WithOSDiskSizeInGB(128) .Create();
Expected behavior
To be able to use PremiumLRS storage without a Storage Account.
Screenshots If applicable, add screenshots to help explain your problem.
Setup (please complete the following information):
- OS: Windows
- IDE : VS2017
- Version of the Library used: latest
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top GitHub Comments
Will take a look
Thank you for opening this issue! We are routing it to the appropriate team for follow up.