microsoft / vscode-azure-account Goto Github PK
View Code? Open in Web Editor NEWCommon Azure Login extension for VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account
License: Other
Common Azure Login extension for VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account
License: Other
... In all UI related strings, like commands, prompt text etc, to align with the AAD sign-in page UI. Visual Studio also uses "Sign in" instead of "Log in".
//Running the sign in command starts a task in the bottom left, but never actually does anyting.
Unless you enter the tenantid in the settings, which is never explained anywhere
Like here (JavaScript supplying tokens): https://msazure.visualstudio.com/One/Azure-CloudShell/_git/compute-CloudShell?path=%2Fsrc%2Fportal%2Fjs%2Fmain.js&version=GBmaster&line=1393&lineStyle=plain&lineEnd=1394&lineStartColumn=1&lineEndColumn=1
And here (C# obtaining tokens): https://msazure.visualstudio.com/One/Azure-CloudShell/_git/compute-CloudShell?path=%2Fsrc%2Fshell%2FPortal%2FServices%2FTokenService.cs&version=GBmaster&line=175&lineStyle=plain&lineEnd=176&lineStartColumn=1&lineEndColumn=1
https://github.com/Microsoft/vscode-azure-account/blob/master/thirdpartynotices.txt#L2
This might be a typo I think.
have a command to launch the portal to the currently selected subscription
So far not reproduced with local tmux.
According to CHANGELOG.md, there has been a 0.1.0 and a 0.1.3 release. However, there doesn't appear to be any tags in the repository.
I think tags should be created so that it's easier to diff between releases for finding bugs and regressions.
Hi @chrmarti
Just find that when we are creating the cloud shell, and the user is not logged in, the extension will execute the code below: https://github.com/Microsoft/vscode-azure-account/blob/master/src/cloudConsole.ts#L125
Then if the user is not logged in previously, he needs to trigger the command again.
Could we await this command instead of return here?
for example:
...
if (!(await api.waitForLogin())) {
await commands.executeCommand("azure-account.askForLogin");
if (!(await api.waitForLogin())) {
// handle login failure
}
}
...
Azure Account extension: 0.3.3
I am very puzzled why I have two not available options: WTETestAd06 and WTETestAd05?
I have been using this extension all day. Now I get this error when opening a bash cloud shell.
Connecting terminal...
{ RequestError: Error: unable to verify the first certificate
at new RequestError
Such as Azure US Gov, Azure China and Azure Germany.
An ideal entry point would be a command like "Switch to ..." then the user picks the Azure environment they want to sign into.
I installed this extension from the marketplace and Azure sign-in worked fine, but the Open Cloud Shell commands were not available. Apparently this requires VSCode version 1.18. Once I had updated, the Cloud Shell commands were available, but returned a message stating that nodeJS 6 is required to launch the cloud shell.
Please consider listing these requirements on the marketplace page and the project readme. Thanks!
When I try to navigate the bash history with reverse-i-search (ctrl-r), or up arrow the text becomes a mess in the terminal window making this kind of navigation impossible to use properly.
Tested on Windows, with VSCode 1.23.0, Azure Account 0.4.0.
Depends on 1.18 API
Version 0.2.2
VS Code 1.18.1
Windows 10 / Mac OS
When I run the Azure : Sign In
task, it displays: Not signed in, sign in first.
After following the prompts, it opens the browser window and after entering the device code, the message is * You have signed in to the Visual Studio Code application on your device. You may now close this window.*.
However, I remained signed-out in VS Code.
I get the exact same behavior when running Azure: Sign-In
again.
The account I sign-in with is a company account and I have more than one tenant id associated with my account.
I can successfully sign-in using the Azure Tools extension. One difference is that the extension requires me to setup my tenant id in configuration file.
Let me know if there is anything else I can do to help.
Trying to login to Azure from VS Code.
I click "copy & open". Browser launches. I paste in code and get the following:
Additional info:
Request Id: 1ddaf81e-366f-4610-b935-4a602e8b1000
Correlation Id: 9b9479fe-83a5-40d4-a2cc-9b3a66859229
Timestamp: 2018-01-30T18:18:21Z
Message: AADSTS90012: This request has timed out
Currently the Azure Account Extension support launch to the cloud shell in the vscode.
If I have a extension depend on Azure Account Extension, is there any way that can get the terminal instance that created by Azure Account Extension, then I can send command to this terminal?
in the latest code insiders version, i am prompted for my computer password every time I open VS Code (insiders only). I uninstalled the entire node pack for azure and it doesnt happen. I am assuming it is something in the latest updates of one of the extensions.
cc @fiveisprime and @chrisdias
After I complete device login through browser, I see the following error in developer console:
Error: Acquiring token with device code failed at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\out\src\azure-account.js:587:28 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\token-request.js:593:8 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\oauth2client.js:503:10 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\async\dist\async.js:4590:26 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\oauth2client.js:415:13 at Request._callback (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\util.js:133:7) at Request.self.callback (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\request\request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:194:7) at Request.<anonymous> (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\request\request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:191:7) at IncomingMessage.<anonymous> (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\request\request.js:1091:12) at Object.onceWrapper (events.js:293:19) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:188:7) at endReadableNT (_stream_readable.js:975:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) t.log @ console.ts:136 console.ts:136 [Extension Host]% Object t.log @ console.ts:136
Error: Acquiring token with device code failed at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\out\src\azure-account.js:587:28 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\token-request.js:593:8 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\oauth2client.js:503:10 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\async\dist\async.js:4590:26 at C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\oauth2client.js:415:13 at Request._callback (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\adal-node\lib\util.js:133:7) at Request.self.callback (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\request\request.js:188:22) at emitTwo (events.js:106:13) at Request.emit (events.js:194:7) at Request.<anonymous> (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\request\request.js:1171:10) at emitOne (events.js:96:13) at Request.emit (events.js:191:7) at IncomingMessage.<anonymous> (C:\Users\somebody\.vscode\extensions\ms-vscode.azure-account-0.3.3\node_modules\request\request.js:1091:12) at Object.onceWrapper (events.js:293:19) at emitNone (events.js:91:20) at IncomingMessage.emit (events.js:188:7) at endReadableNT (_stream_readable.js:975:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) t.log @ console.ts:136 console.ts:136 [Extension Host]% Object t.log @ console.ts:136
The Azure Account extension has a pretty generic, color-less icon, especially as compared to the other Azure extensions:
We should update the extension to use the subscription "key" as seen in the Portal:
You can find a the subscriptions icon used by the other Azure extensions here:
https://github.com/Microsoft/vscode-azuretools/blob/master/ui/resources/azureSubscription.svg
the change in VS Code to move to ASAR changes where to find keytar
, line 27 of azure-account.ts:
keytar = require(`${env.appRoot}/node_modules/keytar`)
should be
keytar = require(`${env.appRoot}/node_modules.asar/keytar`)
Running from source, clicked on Azure: Login, did the device dance and then get this:
Error: Aquiring token with refresh token
at /Users/chris/src/vscode-azurelogin/out/src/azurelogin.js:361:28
at Request._callback (/Users/chris/src/vscode-azurelogin/node_modules/adal-node/lib/util.js:133:7)
at Request.init.self.callback (/Users/chris/src/vscode-azurelogin/node_modules/request/request.js:188:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:194:7)
at Request.<anonymous> (/Users/chris/src/vscode-azurelogin/node_modules/request/request.js:1171:10)
at emitOne (events.js:96:13)
Hello,
I have authenticated to azure and can see list of 10 subscriptions I have access to, when I launch cloudshell I'm not being asked which subscription I shall use and it picks one randomly looks like from the ones I have.
How do I indicate or switch to different subscription in cloud shell?
When trying to start a cloud shell, I have to sign in with the code provided. When I do this, it doesn't work because my account has MFA enabled. Normally when I connect to Azure I'm using a service principal as a workaround. The account extension doesn't seem to accept this. So the question is, can the extension get enhanced with the possibility to sign in with a service principal please, so that the cloud shell can be used?
macOS Sierra (latest)
VS Code (1.21.1)
Azure Account Ext:0.3.3
Azure Functions Ext: 0.8.0
Azure Cosmos DB ext: 0.5.1
I have two azure subs. By default, both are showing in functions and cosmosdb panes.
When I use the F1 Select Subscriptions, I can't figure out how to make my selection stick. I'm tring to have only one sub show.Starting by deselect all, then If I use the mouse to check an option then hit enter, it then acts as though I chose Select All. If use the mouse to check the sub I want and then hit tab, the menu closes but my options don't seem to change. Both subs are still listed in the function panes. Even if I close and open VS Code. After that if I F1 to select subscriptions again, it is set to select all.
Is it possible to filter subs using the resource filter setting?
Can you make this work also with Azure Key Vault data plane? As per key-vault-node-getting-started: "We then perform an authentication handshake with the KeyVault service before creating a KeyVaultClient object." If you just provide session credentials, you will get 401 unauthorized.
Otherways, this is an excellent extension. Good work!
I tried something like this:
const client = new keyVault.KeyVaultClient(this.azureResourceFilter.session.credentials);
const secrets = client.getSecrets(uri).catch( (err) => {console.log(err.statusCode)});
which gives 401 in console.
The same approach on keyVaultManagementClient works fine. Access rights on data plane in Azure is also fine, same user (me) has both management and data access.
Love this extension, however, it seems I have to keep opening new bash shell cloud shell after a few minutes. I try typing in the shell window and nothing shows up at the cursor.
From @jdneo in #45 (comment):
Hi @chrmarti I found out a way to reproduce Entry not found in cache
error. Just trigger the Azure: Open bash in clould shell
twice.
More details can be found in the gif below:
User reported. This will be consistent with the Portal and PowerShell.exe
In order to use a cloud console I have to set up storage account. In the portal, a "dialog" appears in the console prompting me for a subscription, or an advanced set up where I specify the resource group, etc.
If in VS code I don't have a storage account set up I'm assuming it will fail. Is there some way to know when this happens and either create the storage account for them or send them to the portal?
User reported: Resizing the Integrated Terminal pane destroys the formatting and repeats the information in a formatted way.
From here: https://github.com/Microsoft/vscode-azure-account/blob/38fa285e0ade1c98f36e353b1b102d456ac7caf4/src/cloudConsole.ts and https://github.com/Microsoft/vscode-azure-account/blob/896dee089b8f65138a0ec33806fa4b821e7e85c3/src/azure-account.ts
With the new notifications UX this is no longer needed, unless you are actually bringing up a modal dialog.
I had tried many times to get link and paste the code. But the azure login never get through on Mac.
Issue Type: Bug
After I try to sign into VSCode, either using Azure:sign in
or using the Azure Functions plugin, it brings me to my browser (Chrome) to sign in with the pasted code. That all works fine but back in VSCode it never actually signs me in.
Extension version: 0.3.3
VS Code version: Code 1.22.1 (950b8b0d37a9b7061b6f0d291837ccc4015f5ecd, 2018-04-06T00:21:13.607Z)
OS version: Darwin x64 17.3.0
Item | Value |
---|---|
CPUs | Intel(R) Core(TM) i5-4258U CPU @ 2.40GHz (4 x 2400) |
Load (avg) | 2, 6, 11 |
Memory (System) | 16.00GB (0.11GB free) |
Process Argv | /Applications/Visual Studio Code.app/Contents/MacOS/Electron -psn_0_36873 |
Screen Reader | no |
VM | 0% |
Request from a customer of the Azure App Service extension:
can the extension be made to support multiple subs cause its annoying to switch every time.
[microsoft/vscode-azureappservice/issues/319]
From @glstream on March 13, 2018 21:32
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes/No
Copied from original issue: microsoft/vscode#45699
Hi,
I'm working on VSCode and I am trying to enable the usage of ASAR for VSCode. This can improve the startup time of VSCode by up to 5%. We are at a point where we are pursuing even such small gains...
I have found that your extension makes an assumption about the disk layout of VSCode's node_modules
:
ms-vscode.azure-account/out/src/azure-account.js:30
keytar = require(`${vscode_1.env.appRoot}/node_modules/keytar`);
To make your extension entirely compatible with a distribution of VSCode that uses ASAR, and to make your extension work with both VSCode stable and VSCode insiders, you will need to try to load from two paths... Something like the following:
function getNodeModule(moduleName) {
try {
return require(`${vscode.env.appRoot}/node_modules.asar/${moduleName}`);
} catch(err) { }
try {
return require(`${vscode.env.appRoot}/node_modules/${moduleName}`);
} catch(err) {}
return null;
}
I plan to release the changes to Insiders this week, such that the Insiders build on Friday, 23.02.2018, will contain the ASAR packing of node modules. In the meantime, I have created custom builds that include this change if you wish to test your extension against a VSCode version which contains these changes:
To solve this issue (microsoft/vscode-azureappservice#211), we need the account extension to cache subscriptions across VS code sessions.
Maybe we can cache the list of subscriptions? When I do F1 | Select Subscriptions it takes a long time for the list to show up. And, when i query for the subscriptions from my extension it can take 10s for them all to return.
my guess is that subscriptions don't change very often, so if we cached that would be ok. if the subscriptions changed, the user would need to reload.
Repro:
Expected:
It opens the browser and I paste the code
Actual: It opens the browser, but nothing is pasted. The code was not copied to the clipboard and the prompt is gone so I can't copy the code manually.
Tested on Ubuntu 16.04. It sounds like the copy-paste package doesn't work if xclip is not installed on the OS by default https://github.com/xavi-/node-copy-paste/issues/56
The error message is printed as "Socket error: {}".
VSCode Version:1.8.1
OS Version: Windows 10 Professional
Steps to Reproduce:
View->Command Pallete-> Azure : Sign In
The popup to provide the device code to run in browser does not open. This results in not able to sign in to Azure account.
Try this without proxy. All works fine. Able to connect Azure account.
Logged in with my [email protected]
account which has a single subscription. However, when I run the "Azure: Subscriptions" command, none are found:
https://github.com/Microsoft/vscode-azurelogin/blob/master/src/extension.ts#L34
subscriptions
array has a length of 0.
If I login using my @microsoft.com id, where I have access to multiple subscriptions, I do see a list.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.