In the Azure portal I created an Automation Account with a Powershell 7.2 runbook. From within the runbook, when I click Edit and choose Edit in VS Code I am then presented with an invitation to install Azure Automation. When I do that, VS Code complains that Azure Account is Depricated.
When I return to the runbook and choose Edit in VS Code I am still prompted to Install Azure Automation.
I tried removing the Azure Account extension in VS Code but this also caused the Azure Automation Extension to be removed.
In the Azure portal I created an Automation Account with a Powershell 7.2 runbook. From within the runbook, when I click Edit and choose Edit in VS Code I am then presented with an invitation to install Azure Automation. When I do that, VS Code complains that Azure Account is Depricated.
When I return to the runbook and choose Edit in VS Code I am still prompted to Install Azure Automation.
I tried removing the Azure Account extension in VS Code but this also caused the Azure Automation Extension to be removed.
Share Improve this question edited Feb 18 at 4:18 Jahnavi 8,0081 gold badge6 silver badges12 bronze badges Recognized by Microsoft Azure Collective asked Feb 15 at 20:33 KirstenKirsten 18.1k50 gold badges207 silver badges359 bronze badges 1- Are you using the latest release? @Kirsten – Jahnavi Commented Feb 17 at 4:11
1 Answer
Reset to default 1The issue is because of the Azure Account Extension deprecation. It has been deprecated since January and the same is described under Vs code Extensions >> Azure Account
.
As a workaround, you can connect to automation runbook by authenticating into Azure using az login
or connect-AzAccount
commands from vs code terminal.
Alternatively, you can use the command palette to sign into Azure even though the extension is deprecated.
As detailed in the MSDoc, you can follow the steps given to choose the runbook from the specific subscription and click on Run local
to execute it in local machine.
I have tried the same in my vs code environment and was able to execute it successfully as shown below.
write-Host "Hello world!"
In the same way, you can also use Az PowerShellSet-AzAutomationRunbook
or Az CLI az automation runbook update
command to connect to automation runbooks from vs code (local) to Azure and work accordingly.