Forum Discussion
How do I run a local Script using my local Azure Cli installation
Could be a stupid question, but didn't found anywhere to information. I'm trying to run a local script to Azure CLI on Mac and i didn't find the correct path or command for that.
Is it a way to do that ?
Local script on Desktop and run Az -
- Hi Guys, I found the problem.. I can just connect Az login directly in the mac console. I was needed to Pwsh and Az login before running the script. Now it's working without issue
- balasubramanimIron Contributor
First, open your Terminal app on Mac. You can find it in Applications > Utilities
Once you're in Terminal, next navigate to the directory where your script is saved
cd ~/DesktopThis takes you to your Desktop directory.
Now, make sure your script is executable. To do this
chmod +x your-script-name.shReplace "your-script-name.sh" with the actual name of your script file.
Finally, run the script!
./your-script-name.shThis executes the script in the current directory.
If you wanna run the script using Azure CLI
az ./your-script-name.shThis runs the script using Azure CLI
- EtienneFisetBrass Contributor
balasubramanimWow, simple as *** i though i was needed to specify the path or upload the file in Azure. Thanks.
Note: i have SA on the sub and RG in Azure and sign-in with az login before.
I'm getting this error now :
- balasubramanimIron Contributor
The error message './test.sh' is misspelled or not recognized by the system typically occurs if your terminal doesn't recognize the script or file location
Verifying your current directory, ensuring the script is executable, and running it with the correct path, you can effectively troubleshoot and resolve the issue.
- EtienneFisetBrass ContributorHi Guys, I found the problem.. I can just connect Az login directly in the mac console. I was needed to Pwsh and Az login before running the script. Now it's working without issue