Code Monkey home page Code Monkey logo

vscode-azure-account's Introduction

Azure Account and Sign In

Version Installs Build Status

Attention extension authors! The Azure Account extension is being replaced by VS Code's built-in Microsoft authentication extension. We've built a wrapper SDK for Azure authentication npm package. If you are creating a new extension that needs authentication to Azure, please use this instead of the Azure Account extension.

The Azure Account extension provides a single Azure sign in and subscription filtering experience for all other Azure extensions. It makes Azure's Cloud Shell service available in VS Code's integrated terminal.

Signing In/Out

There are multiple commands accessible via the command palette that may be used to sign into Azure.

Sign in commands in the command palette

Sign out of Azure using the Azure: Sign Out command.

The sign out command in the command palette

Azure Cloud Shell

Azure Cloud Shell instances can be started via the terminal view in VS Code. To begin, click the dropdown arrow in the terminal view and select from either Azure Cloud Shell (Bash) or Azure Cloud Shell (PowerShell).

VS Code terminal view with context menu

If this is your first time using the Cloud Shell, the following notification will appear prompting you to set it up.

"Must setup cloud shell" notification

The Cloud Shell will load in the terminal view once you've finished configuring it.

The Azure Cloud Shell in the terminal window

You may also upload to the Cloud Shell using the Azure: Upload to Cloud Shell command.

Commands

Command
Azure: Sign In Sign in to your Azure subscription.
Azure: Sign In with Device Code Sign in to your Azure subscription with a device code. Use this in setups where the Sign In command does not work.
Azure: Sign In to Azure Cloud Sign in to your Azure subscription in one of the sovereign clouds.
Azure: Sign Out Sign out of your Azure subscription.
Azure: Select Subscriptions Pick the set of subscriptions you want to work with. Extensions should respect this list and only show resources within the filtered subscriptions.
Azure: Create an Account If you don't have an Azure Account, you can sign up for one today and receive $200 in free credits.
Azure: Upload to Cloud Shell1 Upload a file to your Cloud Shell storage account

1 On Windows: Requires Node.js 6 or later to be installed (https://nodejs.org).

Settings

Name Description Default
azure.resourceFilter The resource filter, each element is a tenant id and a subscription id separated by a slash.
azure.showSignedInEmail Whether to show the email address (e.g., in the status bar) of the signed in account. true
azure.tenant A specific tenant to sign in to. The default is to sign in to the common tenant and use all known tenants.
azure.cloud The current Azure Cloud to connect to. Azure
azure.ppe Development setting: The PPE environment for testing.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Telemetry

VS Code collects usage data and sends it to Microsoft to help improve our products and services. Read our privacy statement to learn more. If you don’t wish to send usage data to Microsoft, you can set the telemetry.enableTelemetry setting to false. Learn more in our FAQ.

License

MIT

The Visual Studio Code logo is under the license of the Visual Studio Code product.

vscode-azure-account's People

Contributors

alexweininger avatar bpasero avatar bwateratmsft avatar chrisdias avatar chrmarti avatar dependabot[bot] avatar jdneo avatar kieferrm avatar kittaakos avatar mateusamin avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar msftgits avatar nturinski avatar philliphoff avatar ramya-rao-a avatar sneezry avatar tecton avatar v-tsun avatar wwlorey avatar yujhongmicrosoft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-azure-account's Issues

List requirements for Cloud Shell commands

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!

Unable to login with an account with MFA enabled.

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?

Using bash history ctrl-r destroys rendering

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.

Create tags for releases

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.

Add API to create a Cloud Shell terminal

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?

Use "Sign In" instead of "Login"...

... 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".

Cloud Console: Prompt to create storage?

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?

Add setup explanation (-> tenantid)

//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

Error: Acquiring token with refresh token

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)

Could we continue the command 'azure-account.askForLogin' when creating cloud shell

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
    }
}
...

Support signing into national Azure

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.

Breaking Change regarding the usage of keytar

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:

'Copy and Open' doesn't work on linux

Repro:

  1. Run 'Azure Login'
  2. Click 'Copy and Open' when prompted

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

Filter on subscriptions is not working for me

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?

Signin failed: Verification code expired

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

Open bash in cloud shell no longer works

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

Add option to disable proxy certificate verification

From @glstream on March 13, 2018 21:32

  • VSCode Version: 1.21
  • OS Version:Mac OSX 10.12.6

Steps to Reproduce:

  1. Open VS Code, down load Azure Accoutn Sign In and Azure Data lake tools.
  2. See warning that says "The binary dependencies are being downloaded, please wait until it completes".
  3. Never can sign into Azure.

Does this issue occur when all extensions are disabled?: Yes/No

Copied from original issue: microsoft/vscode#45699

prompted for password for keychain

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.

image

cc @fiveisprime and @chrisdias

Azure Account Sign-In does not work in VSCode when behind proxy

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.

Cache subscriptions

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.

Cloud Shell feedback

  • Call out which shell is running in the terminal name
  • Call out which shell is taking long in the 'provisioning' message
  • Avoid having to click 'Copy&Open' to advance the login

Cloud Shell rendering issue with tmux

  • Open Bash in Cloud Shell
  • Run tmux and split vertically (Ctrl + b, %)
  • Switch between panels and add some output (Ctrl + b, o)
  • Sometimes the vertical ruler between the panels disappears, sometimes parts of the text in one of the panels disappears

So far not reproduced with local tmux.

Unavailiable options for me when opening cloudshell

Azure Account extension: 0.3.3

  1. Install Azure account extension from the market place
  2. Azure Sign in
  3. After successful login, execute the command from Command palette: Azure: Open Bash in Cloud Shell

Result: pop up three options
image

  • if I click Microsoft, works fine(con set up in the web application successfully and open the cloudshell )
  • if I click WTETestAd06 or WTETestAd05, set up web application, shown as below
    image

I am very puzzled why I have two not available options: WTETestAd06 and WTETestAd05?

Azure:Sign In shouldn't fail if at least one tenant authentication succeeds

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.

How do I select a subsription to which cloudshell will be attached?

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?

Request timeout

Trying to login to Azure from VS Code.

I click "copy & open". Browser launches. I paste in code and get the following:

image

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

Unable to Sign In

I'm getting the following error when trying to sign in (or try any other commands in the extension)

azure extension signin issue

asar breaks finding keytar

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`)

Azure Key Vault data plane requires additional step?

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.

Supply graph and key vault tokens to Cloud Shell

No indication that there are no subscriptions

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

System Info
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%

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.