3,060 questions
3
votes
2
answers
99
views
In Powershell, error when calling Azure Log Analytics query containing 'extend'
With the below KQL query, I'm extracting accesses to Azure Key Vault secrets and keys in log analytics, by extracting name of the Key Vault resource (kv) and its accessed keys and secrets (sec) from '...
0
votes
1
answer
36
views
WebJob deployment failing "The term 'Publish-AzWebJob' is not recognized as the name of a cmdlet, function, script file, or operable program"
I have app service which hold > 10 web jobs. So far using
Invoke-RestMethod -Uri $kuduApiUrl -Headers $zipHeaders -Method PUT -InFile $zipPackageFile
Apparently it is deprecated. So now we tried:
...
0
votes
1
answer
62
views
Unable to fetch private endpoint's customer visible fqdn using the powershell script
I have the resoruces in the resource group with the virtual network integrated, public network access disabled and having private endpoints connectivity.
I'm trying to fetch the customer visible DNS (...
0
votes
1
answer
284
views
How to check Microsoft API version for Powershell related codes?
My organisation got an email from Microsoft recently:
Azure SQL Database 2014-04-01 APIs will be retired on 31 October 2025
You’re receiving this email because you use Azure SQL Database APIs.
To ...
0
votes
1
answer
135
views
Azure ApplicationAccessPolicy not blocking access for certain users in Microsoft Graph API (application permission)
I am using an ApplicationAccessPolicy in Exchange Online to restrict an Azure AD application’s access to only one specific mailbox (my personal account).
The goal is for the application to only access ...
0
votes
0
answers
93
views
Azure DevOps: $(MyTask.Succeeded) returns false even when task is skipped — how to reliably detect task status?
I’m using Azure DevOps pipelines and trying to determine if certain steps like Docker push, Helm push, or GitHub tagging were successful. I'm using the .Succeeded property of previous tasks to ...
1
vote
2
answers
368
views
Has there been a recent change to Invoke-Sqlcmd that break it, and if so what's the fix?
I have a script that runs in an Azure DevOps pipeline that was working up until this morning (18/6/2025).
I previous had to upgrade a MS Graph Access token breaking change here
The Azure DevOps ...
0
votes
2
answers
65
views
Bug with Azure Powershell command New-AzActivityLogAlert
I have the following code
# Variables
$task3storageAccountName = "testRG"
$actionGroupName = "Storage Admins"
$actionGroupShortName = "SA Admins"
$notificationName = &...
1
vote
1
answer
114
views
How can I more simply update an AzActivityLogAlert ActionGroup?
I'm using a PaaS system that comes preconfigured on Azure with a large number of alerts. I want to update these alerts with an Azure Az Powershell v14 script by adding an Action Group to them, to get ...
-1
votes
1
answer
128
views
Azure container instance : why can't I create an ACI using PowerShell?
I would like to create ACI using the following command in PowerShell:
New-AzContainerGroup -ResourceGroupName acr -Name benighilmohamed `
-Image alpine -OsType Linux `
-Command "echo 'Hello ...
3
votes
1
answer
3k
views
Azure Devops Service Connection Access blocked to AAD Graph API for this application
I am creating an app registration and adding app roles to the app registration via AzurePowershell task via Azure Devops YAML file.
This worked for months and the last time I did a successfull ...
1
vote
1
answer
88
views
Bad Request on using New-AzSqlSyncMember powershell command
I am trying to set up a Sql Sync Member to a database in another tenant using the New-AzSqlSyncMember however whenever i run it get the error message
New-AzSqlSyncMember: Long running operation ...
0
votes
1
answer
507
views
Using update-mguser to add / update user's authentication email methods in powershell unattended script
I am attempting to use update-mguser in an unattended powershell script. I can't use New-MgUserAuthenticationEmail or update-MgUserAuthenticationEmail because they don't support application ...
1
vote
1
answer
126
views
Azure PowerShell script Add-Type "Kusto.Data.dll" give load exception for System.Runtime.dll
I have to load types defined in kusto.data.dll for making Kusto query to get data from Azure Data Explorer cluster.
When I use Add-Type -LiteralPath $packagesRoot, it fails with Unable to load one or ...
0
votes
1
answer
79
views
Azure automation runbook powershell to run Azure Data Explorer cluster data query
I have to run kusto query for my ADX cluster to get some data from Database from my Runbook. currently rest of the commands/scripts in my runbook are in Powershell, but I am not able to find ...
0
votes
0
answers
66
views
Invoke-SqlCmd "Login failed for user"
I am trying to run a Powershell script off of a VM using Azure to automate a report coming from a SQL DB. I am running it via a job in Logic Apps but when testing the current script I am getting a &...
0
votes
1
answer
373
views
How to fix error 403 Forbidden when accessing partner center API to retrieve customers and users
Am currently battling error 403 forbidden in my partner center API requests and am unable to know what i might be missing or doing wrong.
I have followed Microsoft documentation but still same issue.
...
0
votes
1
answer
454
views
Function App ERROR: ClientCertificateCredential authentication failed: Could not find tenant id for provided tenant domain 'XXXXX'
I have a Time Trigger Azure function which runs a PowerShell script to fetch some data from Azure. The trigger fails throwing below error.
"ERROR: ClientCertificateCredential authentication ...
0
votes
1
answer
77
views
Set-AzKeyVaultAccessPolicy overwrote another objects policy instead of adding
We have an azure pipeline that adds get permissions to a keyvault using powershell.
Set-AzKeyVaultAccessPolicy -ResourceGroupName $MyResourceGroupName -VaultName $MyKeyVaultName -ObjectId $MyObjectId -...
0
votes
1
answer
106
views
Restore a database in Azure SQL Managed Instance to a previous point in time
I created a powershell script below and I scheduled every day with SQL Agent Job SSMS to restore database from automatic backup azure managed instance , but I have this error:
The term 'Get-...
0
votes
1
answer
125
views
"InvalidOperation: Unable to find type [Azure.Response]." in Azure PS script
I'm writing a script using Azure PS and I am used to typing all variables explicitly as it helps me avoid surprises. I found that when I type the variables storing results of API calls returning Azure....
0
votes
1
answer
76
views
Powershell Azure command to get the Tags associated with an Operation for an API version in Azure API Management
Looking for a command or set of commands that can associate an Operation and its corresponding tags of a API version in Azure APIM
0
votes
1
answer
169
views
PS script to fetch the list non-compliance resource list with respect to policy from multiple subscriptions
I am trying to fetch a list of non-compliant resources via email for a particular policy across multiple subscriptions. However, I'm currently unable to achieve this. Here's what I've done so far:
...
3
votes
1
answer
155
views
Need to enable VM Replication using azure bicep with Powershell script
Need to enable VM Replication using azure bicep with PowerShell script .I have created the configuration like rsv.bicep. while enabling VM replication using PowerShell script ,Variables & ...
0
votes
1
answer
271
views
Get-RemoteDomain in powershell exchange online error : The term 'Get-RemoteDomain' is not recognized as the name of a cmdlet
All required modules were installed, as for example I can run Get-mailbox command.
I'm using certificate based authentication , the service principal is in Global administrators group and Azure ...
0
votes
1
answer
410
views
Want to do a mass update an Azure DevOps work items with lookup and replace with PowerShell?
I have created a non-standard customized work item in ADO called "Resource".
I want to a method (assumed PowerShell script with ADO REST API) to do the following:
Pull or loop through all ...
-1
votes
1
answer
68
views
Update VCore by database in power shell
best regards!
I've this code in powersheel in Runbook from Azure.
Connect-AzAccount -Identity
Get-AzSubscription
Select-AzSubscription -SubscriptionId "xxxxxxxxxxxxxx"
# Definir variáveis
$...
0
votes
1
answer
116
views
Invoke-RestMethod : The remote server returned an error: (403) Forbidden. enable Audit for disabled mailbox from exchange online - powershell
I need to check for disabled audit mailbox in exchange online and enable it.
I have registered app in azure with all the required permissions granted.
I need to use powershell to perform this.
This is ...
0
votes
1
answer
321
views
Azure PowerShell: New-AzRoleAssignment doesn't work with ApplicationId instead of ObjectId
despite azure documentation I don;t think you can use New-AzRoleAssignment with ApplicationId inplace of of ObjectId
docs: https://learn.microsoft.com/en-us/powershell/module/az.resources/new-...
0
votes
1
answer
206
views
Retrieving the azure latest IP ranges using PowerShell Script
I am trying to retrieve the latest Microsoft Azure IP ranges from the official page:https://www.microsoft.com/en-us/download/details.aspx?id=56519 using Power. My goal is to create a new JSON file ...
0
votes
1
answer
87
views
Atomic Red Team over Azure Pipeline
I have an elastic environment with two agents enrolled on the fleet server. One Agent is my local machine, the other agent is a windows client from azure pipeline. The goal is to run the azure ...
0
votes
1
answer
154
views
Azure Policy Definition using Powershell
I am trying to create az azure policy definition using powershell and I am receiving the following error.
New-AzPolicyDefinition_CreateExpanded : Failed to parse policy rule: 'Error converting value &...
0
votes
2
answers
106
views
The template output 'ctrName' is not valid: The language expression property array index '4' is out of bounds
Unable to understand the error during the deployment of Azure Container Registries using BICEP Template:
Error:
6:30:16 AM - The deployment 'ContainerRegistriesDeployment' failed with error(s).
...
0
votes
1
answer
71
views
New-AzResourceGroupDeployment: 4:21:36 PM - The deployment 'FileStorageDeployment' failed with error(s). Showing 1 out of 1 error(s)
Storage Account BICEP Code:
param stAccName string
resource storageAcc 'Microsoft.Storage/storageAccounts@2023-05-01' = {
name: stAccName
location: resourceGroup().location
sku: {
name:'...
0
votes
1
answer
143
views
Azure: Creating Linux VM returns Required parameter 'osProfile.computerName' is missing (null)
I'm trying to run a very trivial PowerShell script to create a Linux VM in Azure.
Script looks like this:
$LocationName = "switzerlandnorth"
$ResourceGroupName = "my_group"
$...
1
vote
1
answer
135
views
How to reference a secret variable from an AzurePowerShell@5 task
Azure Pipelines allows for secret variables to be defined within the pipeline UI. The Microsoft docs say that, in order to use these variables in script tasks, they should be mapped to environment ...
1
vote
1
answer
68
views
Create Pipeline via Azure Powershell and pipelineReturnValue activity is not properly created
I try to run this command in Azure Powershell
Set-AzDataFactoryV2Pipeline -Force -ResourceGroupName MY_DEV_RESOURCE_GRP -DataFactoryName MYADF001 -Name PL_PROCESS_API -DefinitionFile ./PL_PROCESS_API....
0
votes
1
answer
169
views
Generating SAS account token in powershell
"I generated a token using Azure and it’s working, but I need to create a correct script in PowerShell using the key. The stringToSign I generated is different from the one provided by Azure, and ...
1
vote
0
answers
36
views
PowerShell "Assembly with same name is already loaded" on different Module Versions [duplicate]
I have a script that requires using two versions of the same module with conflicting assemblies:
#Requires -PSEdition Core
# main logic
Install-Module -Name MyModule -RequiredVersion 2 -Scope ...
0
votes
2
answers
676
views
Is it possible to assign a Power BI Pro License to an Azure Service Principal? Deploy .bim in PBI Service without Premium Workspace
I am trying to find how to automatically deploy PBI Datamodels to a Workspace in PBI Service while maintaining CI/CD. I found this three pages tutorial and I have tried to replicate it https://...
0
votes
1
answer
132
views
Add EventGridSystemTopicEventSubscription with deadletter not working with powershell
I want to create an event subscription for a FunctionApp but can not find how to define the DeadletterEndpoint. My pipeline has Az module v12.5.0 installed.
The following code is working but how can I ...
0
votes
1
answer
142
views
Using the New-AzSentinelDataConnector cmdlet
I have tried using the New-AzSentinelDataConnector cmdlet to create or update a data connector.
I have not fully gotten this solution working, trying to enable the Microsoft Entra ID data connector.
...
1
vote
1
answer
284
views
Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backtick (`)
When running the below azure pipeline, I get the error:
Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backtick (`).
This ...
0
votes
1
answer
106
views
Azure Run Command Error: The string is missing the terminator: "
I'm attempting to map an Azure Storage Account file share via Run Command in the portal:
$storageAccountKey = 'key'
$storageAccountName = 'account'
$securePass = $storageAccountKey | ConvertTo-...
0
votes
1
answer
130
views
How to grant dashboard (manage) permission to System.AccessToken for updating a dashboard widget using Azure DevOps REST API?
I want to call Azure DevOps REST API's Widgets - Update Widget endpoint from an Azure Devops Build Pipeline.
I'm calling the endpoint from a powershell task and I am passing the System.AccessToken in ...
0
votes
1
answer
270
views
Poweshell to set Azure SQL Auditing
I am trying to use powershell and possibly diagnosticsettings to set the below values in sql server (red ones)
and send the log to Event hub,
here is my ps script:
New-AzDiagnosticSetting -ResourceId ...
0
votes
2
answers
51
views
Powershell how to use azure vault secret value using yaml
I am new to yaml file, I am facing issues.
error : "The term 'devkey' is not recognized as a name of a cmdlet, function, script file, or operable program."
I have variable group called ...
0
votes
2
answers
119
views
Better way to deal with multiple foreach loops in Powershell?
Is there a better way in Powershell to handle multiple levels of returned values than nested foreach loops?
I need to get a list of each of our Azure Virtual Desktop session hosts for further ...
0
votes
1
answer
110
views
Azure VM, extension script in powershell, how to pass as a parameter json object
I have a script in Powershell, I would like to run it as a script extension in Azure VM. The script is supposed to download various things, and the configuration would enter it as an object. What can ...
0
votes
3
answers
459
views
Azure PowerShell command to list all Azure VM SKU Sizes enabled for Confidential Computing Azure ACC
Get-AzVMSize -Location "West US"
The command above returns a list of all Azure VM SKU sizes in this format.
Name NumberOfCores MemoryInMB MaxDataDiskCount ...