jrudlin / azure Goto Github PK
View Code? Open in Web Editor NEWAll things Azure
All things Azure
When i trying to runn command "$NewManagedDisk = New-AzDisk -ResourceGroupName $resourceGroupName -DiskName $NewDiskName -Disk $diskConfig". I am getting the error.
New-AzDisk: Changing property 'sourceUri' is not allowed for existing disk 'diskName'.
ErrorCode: BadRequest
ErrorMessage: Changing property 'sourceUri' is not allowed for existing disk 'diskName'.
ErrorTarget:
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : b19610a7-e2f3-4408-9ffb-6ff631e53d50
So i followed this guide https://jrudlin.github.io/2019-09-02-windows-virtual-desktop-azure-devops-ci-cd-packer-build-and-release/ and its building the image fine, except that it gives an error when connecting to the Azure file Share through powershell.
https://pastebin.com/yu6P1Uq2 This is my config.json file
The error i am getting:
==> azure-arm: Provisioning with Powershell...
==> azure-arm: Provisioning with powershell script: C:\Users\VSSADM~1\AppData\Local\Temp\powershell-provisioner098073359
==> azure-arm: AppInstallsStorageAccountName : The term 'AppInstallsStorageAccountName' is not recognized as the name of a cmdlet,
==> azure-arm: function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
==> azure-arm: At C:\Windows\Temp\script-60911f9d-8fde-ee90-1cbb-1aeff1ba219d.ps1:3 char:20
==> azure-arm: +
==> azure-arm: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
==> azure-arm: + CategoryInfo : ObjectNotFound: (AppInstallsStorageAccountName:String) [], ParentContainsErrorRecordException
==> azure-arm: + FullyQualifiedErrorId : CommandNotFoundException
Any clue where i misconfigured something?
I suggest changing 39 line in https://github.com/jrudlin/Azure/blob/master/General/Shrink-AzDisk.ps1
$storageAccountName = "sashrinkddisk" + ($($VMName -replace '[^a-zA-Z0-9]', '')).ToLower()
to
$storageAccountName = "shrink" + [system.guid]::NewGuid().tostring().replace('-','').substring(1,18)
to account for errors like "....is not a valid storage account name. Storage account name must be
between 3 and 24 characters in length and use numbers and lower-case letters only."
Good day,
What modifications are required to the script to shrink data disks
Regards
Suraj
Thanks for the great script, worked well, I had 1 issue.
With the New-Disk config, it didn't create the right SKU and didn't set a zone for the new disk.
Which then errors on attaching the disk to VM, due to incorrect Zone.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.