future-kite-91191
12/08/2020, 7:47 AMpulumi up
.
I'm logged in successfully to Azure via az login
still the pulumi up
command keeps asking for interactive sign-in via web page:
To sign in, use a web browser to open the page <https://microsoft.com/devicelogin> and enter the code {code here} to authenticate.
E1208 08:11:52.773315 15608 azure.go:154] Failed to acquire a token: failed acquiring new token: waiting for device code authentication to complete: autorest/adal/devicetoken: Error while retrieving OAuth token: Code Expired
Eventually the command times out. I'm on Pulumi version 2.15.3 and latest npm packages
Additional details: I can get a correct preview of the stack:icy-jordan-58549
12/08/2020, 11:32 AMcontainerservice.listManagedClusterAdminCredentials({
resourceGroupName,
resourceName
});
devicelogin
every single timepublic static getKubeconfig(
clusterName: pulumi.Input<string>,
resourceGroupName: pulumi.Input<string>
): pulumi.Output<string> {
const creds = pulumi
.all([clusterName, resourceGroupName])
.apply(([resourceName, resourceGroupName]) => {
return containerservice.listManagedClusterAdminCredentials({
resourceGroupName,
resourceName
});
});
const encoded = creds.kubeconfigs[0].value;
return encoded.apply(enc => Buffer.from(enc, 'base64').toString());
}
public static getProvider(
name: pulumi.Input<string>,
kubeconfig: pulumi.Input<string>,
opts?: pulumi.ResourceOptions
): k8s.Provider {
return new k8s.Provider(
`${name}-k8s`,
{
kubeconfig,
suppressDeprecationWarnings: true
},
opts
);
}
future-kite-91191
12/08/2020, 12:19 PM