azure powershell
9 TopicsAzure powershell Set-AzStorageLocalUser - how to use existing ssh key in azure?
I am trying to build powershell script to create a local user for sftp in the Azure Stroage account. We have ssh keys already created in Azure. When the local user is created, existing ssh key created in azure should be assigned to the user. This can be easily done through Azure portal. However, we are looking for the same option in the powershell commandlet. Set-AzStorageLocalUser has option for "sshAuthorizedKey", but there is no option to select existing key. Do we know how this can be achieved?Solved300Views0likes4CommentsPowershell error with the below code
Hi Champions, Can someone please help me with the below powershell code which i want to upload the key vault secrets excel csv file to azure key vault. But it is giving below error. $keyVaultName = "Test-marketing" $data = Import-Csv "C:\Users\Ram.Muppaneni\Downloads\marketing.csv" # Iterate over each row in the CSV and create/update the secrets in the Key Vault foreach ($row in $data) { $secretName = $row.Name $secretValue = $row.Secretvalue # Create or update the secret Set-AzKeyVaultSecret -VaultName $keyVaultName -Name $secretName -SecretValue $secretValue } Getting below error: Line | 6 | … -VaultName $keyVaultName -Name $secretName -SecretValue $secretValue | ~~~~~~~~~~~~ | Cannot bind argument to parameter 'SecretValue' because it is null. Excel csv file columns and sample data are below three Name Secretvalue Type Marketing password1 kitchen refrigerator password I would like to add the above column "Type" as well to the code which needs to upload the data to the keyvault along with the Name and Secretvalue. Please assist. Looking forward to hear from you. Cheers, RamSolved2.5KViews0likes17CommentsParallel VM restore in PowerShell
Deal All, When I try to run Parallel VM restore in PowerShell, I receive the following error message. We have functions for restoring, but the Parallel one does not work, could someone please assist me with this? # Function to run the restore process for VMs in parallel using PowerShell runspaces function Restore-VMsInParallel { param ( [array]$VMsInfo ) $runspacePool = [RunspaceFactory]::CreateRunspacePool(1, [System.Management.Automation.Runspaces.Runspace]::DefaultRunspace) $runspacePool.Open() $jobs = @() foreach ($vmInfo in $VMsInfo) { $job = [PowerShell]::Create().AddScript({ param ($info) Restore-VMAndSnapshots -SubscriptionId $info.SubscriptionId -ResourceGroupName $info.ResourceGroupName -VMName $info.VMName }).AddArgument($vmInfo) $job.RunspacePool = $runspacePool $jobs += $job } $results = $jobs | ForEach-Object { $_.BeginInvoke() } $jobs | ForEach-Object { $_.EndInvoke($_) } $runspacePool.Close() $runspacePool.Dispose() } # Read VM details with snapshot information from the CSV file $csvFilePath = "C:\CSV\file.csv" $vms = Import-Csv -Path $csvFilePath # Create an array to store VM information $vmInfoArray = @() # Convert CSV data to VM information array foreach ($vm in $vms) { $vmInfo = @{ ResourceGroupName = $vm.ResourceGroupName VMName = $vm.VMName SubscriptionId = $vm.SubscriptionId } $vmInfoArray += New-Object PSObject -Property $vmInfo } # Restore all VMs in parallel Restore-VMsInParallel -VMsInfo $vmInfoArray741Views0likes3CommentsHow to list azure resources which have inheriting access and direct access using powershell
Hi, Is it really possible to list azure resources which have inherited access and direct access using Powershell? I couldn't find any azure PowerShell command which shows at least any column which has this information. Can anyone help me here, please?Solved7.2KViews0likes5CommentsAzure PowerShell Docker image
Running simultaneously different scripts using different versions of Azure PowerShell, testing a script against a new version of Azure PowerShell modules, locking a script with a known version of Azure PowerShell is now possible with the first availability of the Azure PowerShell Docker image.9KViews4likes1CommentVIDEO: Mastering Azure using Cloud Shell, PowerShell and Bash!
I recorded my presentation and made it available for everyone. The presentation is a live demo and summary of my blog post “Mastering Azure with Cloud Shell“, which gives you an overview about the Cloud Shell and some of the advanced stuff you can do. In the session you learn: Overview about Cloud Shell Azure PowerShell and Bash experience Persistent Storage using Azure Files Azure Drive Third party tools Editors Visual Studio Code integration Using Git as Source Control Remote manage Azure virtual machines Integration of Cloud Shell in Microsoft Docs, Microsoft Learn and more Cloud Shell in the Azure Mobile App and more. I hope you enjoy watching it and let me know what you think in the comments.1.6KViews1like0Comments