Questions tagged [az]

86 questions
26
votes
3 answers

Change Azure directory from command line

I'm trying to use az against my Azure account. My account has two directories: one for personal (default) and one for business. I need to "switch to" the business directory so that az has access to the correct resources. However, I cannot find any…
me--
  • 1,978
  • 1
  • 22
  • 42
10
votes
3 answers

Supplying an input file via '@' gives an error: The splatting operator '@' cannot be used to reference variables in an expression

Following this example here https://learn.microsoft.com/en-us/cli/azure/vm/run-command?view=azure-cli-latest I'm getting an error when running my command az vm run-command invoke --command-id RunPowerShellScript --name win-vm -g my-resource-group…
Ryvik
  • 363
  • 1
  • 3
  • 14
5
votes
1 answer

C# console application authentication session

How could someone implement the az login (Azure CLI) experience in a C# Console application? In that case, a browser window is opened, the user authenticates and after that he can access the private resources. My guess is that the authentication…
fra
  • 3,488
  • 5
  • 38
  • 61
5
votes
2 answers

Add members to Azure Enterprise App through CLI

We have an enterprise application in our Azure AD tenant for provisioning users to another SaaS platform. Currently it is only setup with the option "Sync only assigned users and groups" since we do not want the whole directory brought over. My…
kanthael
  • 105
  • 2
  • 5
5
votes
2 answers

The 'Get-azVM' command was found in the module 'Az.Compute', but the module could not be loaded

I have used Az module in powershell script which is getting executed from powershell core but getting error while executing the script from application (.Net core SDK 2.1). $VMExistanceCheck = Get-azVM -ResourceGroupName $VMResourceGroup -Name …
SRoy
  • 61
  • 1
  • 1
  • 6
4
votes
1 answer

The Resource (SQL Server) under resource group was not found

When I'm trying to fetch DB in elastic pool getting error as: The Resource 'Microsoft.Sql/servers/dbserver.database.windows.net/databases/db_name' under resource group 'rg_name' was not found. But for other DB servers and resource group, this…
Akash Samal
  • 87
  • 1
  • 9
4
votes
1 answer

How to add a tag when creating a work-item with az cli

I'd like to create a product backlog item with tag by using the az cli (devops). Creating the PBI works fine (az boards work-item create --type 'product backlog item' --title 'my pbi' -d 'some desc' --area --iteration ). However, the cli does not…
Malagueta
  • 43
  • 3
4
votes
1 answer

Az / AzureRM / Legacy Azure Powershell Conflicts

I'm trying to upgrade from AzureRM to the new Az module for powershell. We still have multiple usages of "legacy" service management API resources, such as classic Azure Cloud Services, and these (as far as I know) still require the use of the old…
RMD
  • 3,421
  • 7
  • 39
  • 85
4
votes
2 answers

Azure DevOps (VSTS) - using Azure Az PowerShell on a Hosted Agent

We use Azure DevOps with a hosted VS2017 build agent. We would like to use the the new Az PowerShell module. However, the VS2017 hosted build agent has AzureRM installed on it. The documentation states You should not install Az side-by-side with…
Murray Foxcroft
  • 12,785
  • 7
  • 58
  • 86
3
votes
2 answers

How to list storage blob url using az cli?

I want to list (programmatically) the url of my blob storage. The url I am looking for is https://my_storageaccount_name.blob.core.windows.net/my_container_name/my_file_name I tried az storage account list and az storage blob show but neither of…
souser
  • 5,868
  • 5
  • 35
  • 50
3
votes
3 answers

Is there a way to create and release azure release pipeline using only az pipelines cli?

I'm trying to automate azure build & release pipeline by using az devops extension cli. I was able to create and run build pipelines. But unable to create release pipelines by only using the cli. Microsoft docs is not helpful at all.
3
votes
1 answer

How to give Azure AD application access to required permissions using powershell Az module

I'm trying to rewrite powershell script that creates Azure AD application and assigns permission to it. The script is using AzureAD module, I would like to use new Az module, so I can run it on Linux/MacOS. Creating a new application is easy…
paulpb
  • 33
  • 1
  • 6
2
votes
1 answer

How do I use the "expand" param in the Azure SDK?

Given this method signature: func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) How does one use the "expand" parameter? There appears to be…
erstaples
  • 1,986
  • 16
  • 31
2
votes
4 answers

Get the Azure Directory Name by PowerShell

How can I get the Azure Directory(Tenant) name in which I have logged in by PowerShell ? I have tried 'Get-AzContext', but it only provides the Tenant ID. Tenant name or default domain name is not included in the output.
Sourav Karmakar
  • 95
  • 3
  • 12
2
votes
0 answers

Azure CLI run command command id RunPowerShellScript passing boolean parameters not working

I've been using Azure CLI to execute powershell scripts inside a vm, even using string parameters. But when the scripts contains a boolean parameter to add, the azure invoke command doesn't pass it to to the script execution. Anyone has succeded to…
1
2 3 4 5 6