Questions tagged [powershell-az-module]
35 questions
5
votes
4 answers
I am getting "PackageManagement\Install-Package : Access to the cloud file is denied" errors while installing Az module in power shell
I am trying to install Az module on windows power shell by "Install-Module -Name Az -Scope CurrentUser -Force -Allowclobber command". But i am getting below error.
PS C:\WINDOWS\system32> Install-Module -Name Az -Scope CurrentUser -Force…

Mohit Kumar Sharma
- 51
- 1
- 2
3
votes
4 answers
Get-AzKeyVaultSecret can't read secret value in Powershell
I'm not able to read the value of one of my secrets in Key Vault. I'm logged in with my Azure account and I have full permission to the selected Key Vault.
I'm able to retrieve a list of available secrets using the following command:
$keyVaultValue…

Lukas Méndez Duus
- 406
- 5
- 17
2
votes
1 answer
install powershell Az.Storage module through VM extension Custom script from terraform
I need to install Az.Storage module in Azure windows VM through terraform VM extension - custom script. every other commands execute, but Module installation command does not execute.
resource "azurerm_virtual_machine_extension" "VMextn202" {
name…

Manoj R
- 57
- 6
1
vote
2 answers
How to make ForEach-Object start counting from 1 instead of 0
I have a nice string that looks like this:
Get-Azsubscription | ForEach-Object {"$($a).) $($_.Name)"; $a++}
It allows me to count how many subscriptions I have on Azure and it adds a number to it. The problem is that the counter starts from 0,…

Francesco Mantovani
- 10,216
- 13
- 73
- 113
1
vote
1 answer
How to find diagnostic setting(AuditEvent) for KeyVault
I am able to find out the diagnostic setting for KeyVault - when I enable it individually by selecting the specified category - AuditEvent using the command Get-AzDiagnosticSetting
But when I enable it by selecting Category Groups - audit & allLogs…

Prashant Shete
- 60
- 10
1
vote
0 answers
PowerShell - How do I bulk upload Certificates to an Azure App Registration Certificate store?
As you can see from the code below I can upload on certificate at a time, but the problem is it wipes out all of the existing certificates when doing so.
$Tenant_ID = '00000000-0000-0000-0000-000000000000'
$Subscription_ID =…

Zack Mayfield
- 11
- 2
1
vote
1 answer
Powershell Get-AzkeyVault AccessPolicies not visible
This is a part of my code
$keyVaults = Get-AzkeyVault | Sort-Object VaultName
foreach($keyVault in $keyVaults) {
$kvName = $keyVault.VaultName
$keyVault | Get-Member
This would result into $keyVault being a…

Harry Leboeuf
- 723
- 12
- 30
1
vote
0 answers
Failing to upload file to Azure Fileshare
I am trying to upload a csv file to azure file share. Below is the cmdlets I am using:
$folderPath="/"
$ctx=(Get-AzStorageAccount -ResourceGroupName 'rg-aexch' -Name 'storaexch').Context
$fileShare = Get-AZStorageShare -Context $ctx -Name…

Biswajeet Kumar
- 45
- 1
- 6
1
vote
1 answer
How to replicate `az login -identity` with pwsh from within a VM assigned a Service Principal
From within a VM with a System Assigned Identity (Not a User Assigned Managed Identity).
I am able to authenticate via the az cli by typing az login -identity and can perform operations based on the RoleAssignments to the VM's Service…

Elliott de Launay
- 1,027
- 13
- 31
1
vote
1 answer
Use Powershell Az Module to Publish Revision to Developer Portal
I have a powershell script that runs within my Azure Devops Release Pipepline for my API which uses the swagger doc from my API to automatically push changes into APIM.
The missing step is that once I have made the revisions, I need to update the…

Josh
- 16,286
- 25
- 113
- 158
1
vote
2 answers
How to create AzureProfile.json file using AzModule command in PowerShell?
I want to create the AzureProfile.json file using the Az Module command in PowerShell, so that I can import the json file anytime I want to login to Azure to start\stop my VM's.
Below is the command\script I am using to create it but it is giving me…

SRP
- 999
- 4
- 21
- 39
0
votes
1 answer
How do I connect to Azure using a Service Principal?
I am trying to connect to Azure non-interactively via on-prem Azure DevOps to apply SQL migrations. I created an App Registration in Azure AD, with a corresponding client secret.
When I run
$appId = {Guid}
$clientSecret = {secret…

David
- 2,782
- 4
- 31
- 47
0
votes
2 answers
Create user with permission to more than one container in azure from PowerShell
I have an Azure storage account with SFTP enabled. I have multiple containers with one user for each container with permissions to only that container.
I would like to also have a user with access to all containers.
I know it is possible to do so in…

Ruwi
- 3
- 3
0
votes
1 answer
Add local user to Azure storage account with SFTP enabled from PowerShell
I have set up an Azure storage account with SFTP enabled and would like to automate the addition of new users.
I would like to set it up with password and not SSH-key.
I am looking to integrate the automated addition of users into a larger setup in…

Ruwi
- 3
- 3
0
votes
0 answers
Powershell : enable virtual machine creation and the maximum number of virtual machines (252) on a devTestLab's subnet
I'm working on a powershell script to enable virtual machine creation and the maximum number of virtual machines (252) on a devTestLab's subnet :
I tried to use the IpConfigurations function but it always returns "null" with my subnet unfortunately…

Halcoaching
- 47
- 5