-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to new Azure SDK packages #197
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change looks good. When I try to sign in I get the success page in the browser, but the VS Code statusbar and the App Services view remain empty. (This is on Mac.)
src/azure-account.api.d.ts
Outdated
readonly userId: string; | ||
readonly tenantId: string; | ||
readonly credentials: ServiceClientCredentials; | ||
readonly credentialsV2: DeviceTokenCredentials; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a more general interface like ServiceClientCredentials in the old SDK? 'Device' refers to the device login flow.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to TokenCredentialsBase
, which seems to be the most general interface for the new SDK
src/cloudConsole.ts
Outdated
@@ -380,7 +380,7 @@ export function createCloudConsole(api: AzureAccount, reporter: TelemetryReporte | |||
// Additional tokens | |||
const [graphToken, keyVaultToken] = await Promise.all([ | |||
tokenFromRefreshToken(session.environment, result.token.refreshToken, session.tenantId, session.environment.activeDirectoryGraphResourceId), | |||
tokenFromRefreshToken(session.environment, result.token.refreshToken, session.tenantId, `https://${session.environment.keyVaultDnsSuffix.substr(1)}`) | |||
tokenFromRefreshToken(session.environment, result.token.refreshToken, session.tenantId, `https://${session.environment.keyVaultDnsSuffix!.substr(1)}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the is a good fallback for when keyVaultDnsSuffix is not available. Maybe CloudShell works without a KeyVault token? (It used to.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just tried without a KeyVault token and it seemed to work fine without it. I'll change this to make the keyVault token optional
@RMacfarlane Actually everything works when running out-of-source, only when installing the packaged VSIX it somehow didn't. Can you give that a try? |
Was it sign in that didn't work? I've just tried packaging and running it as a VSIX and have been able to sign in and open a cloud console. Edit: Ah, you answered that above. I'll self host with it for the rest of today and see if I can repro |
I see the following in the console when running with the VSIX, but not when running with
|
This appears to be node-fetch/node-fetch#784. Just not throwing the error by manually removing it makes it work. The solution on that issue was to not minify class names. How did you build the VSIX avoiding this issue? |
Hmm, I'm just building with |
What do you get for regex searching for class i extends r.EventTarget{constructor(){throw super(),new TypeError("AbortSignal cannot be constructed directly")} ... Its name has been minified to Searching for "AbortSignal"!==t.constructor.name)}(a))throw new TypeError("Expected signal to be an instanceof AbortSignal"); Do you have these too? I'd expect so. Maybe you just don't run through this code for some reason? |
Ah, thanks, I do see the same minification in the output, so I must just not be hitting that code path for some reason. I pushed a change to turn off minification, which unfortunately doubles the size of the |
Preserve AbortSignal class name
#140
Migrate to using the new Azure SDK packages internally, but continue to expose the old credentials object in the API for backcompatability. Introduces a new "credentialsV2" property corresponding to the new credentials object