@@ -34,14 +34,14 @@ const (
3434 identityServerThumbprint = "IDENTITY_SERVER_THUMBPRINT"
3535 headerMetadata = "Metadata"
3636 imdsEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
37+ miResID = "mi_res_id"
3738 msiEndpoint = "MSI_ENDPOINT"
39+ msiResID = "msi_res_id"
3840 msiSecret = "MSI_SECRET"
3941 imdsAPIVersion = "2018-02-01"
4042 azureArcAPIVersion = "2019-08-15"
43+ qpClientID = "client_id"
4144 serviceFabricAPIVersion = "2019-07-01-preview"
42-
43- qpClientID = "client_id"
44- qpResID = "mi_res_id"
4545)
4646
4747type msiType int
@@ -286,7 +286,7 @@ func (c *managedIdentityClient) createIMDSAuthRequest(ctx context.Context, id Ma
286286 q .Add ("resource" , strings .Join (scopes , " " ))
287287 if id != nil {
288288 if id .idKind () == miResourceID {
289- q .Add (qpResID , id .String ())
289+ q .Add (msiResID , id .String ())
290290 } else {
291291 q .Add (qpClientID , id .String ())
292292 }
@@ -306,7 +306,7 @@ func (c *managedIdentityClient) createAppServiceAuthRequest(ctx context.Context,
306306 q .Add ("resource" , scopes [0 ])
307307 if id != nil {
308308 if id .idKind () == miResourceID {
309- q .Add (qpResID , id .String ())
309+ q .Add (miResID , id .String ())
310310 } else {
311311 q .Add (qpClientID , id .String ())
312312 }
@@ -329,7 +329,7 @@ func (c *managedIdentityClient) createAzureMLAuthRequest(ctx context.Context, id
329329 if id .idKind () == miResourceID {
330330 log .Write (EventAuthentication , "WARNING: Azure ML doesn't support specifying a managed identity by resource ID" )
331331 q .Set ("clientid" , "" )
332- q .Set (qpResID , id .String ())
332+ q .Set (miResID , id .String ())
333333 } else {
334334 q .Set ("clientid" , id .String ())
335335 }
@@ -351,7 +351,7 @@ func (c *managedIdentityClient) createServiceFabricAuthRequest(ctx context.Conte
351351 if id != nil {
352352 log .Write (EventAuthentication , "WARNING: Service Fabric doesn't support selecting a user-assigned identity at runtime" )
353353 if id .idKind () == miResourceID {
354- q .Add (qpResID , id .String ())
354+ q .Add (miResID , id .String ())
355355 } else {
356356 q .Add (qpClientID , id .String ())
357357 }
@@ -411,7 +411,7 @@ func (c *managedIdentityClient) createAzureArcAuthRequest(ctx context.Context, i
411411 if id != nil {
412412 log .Write (EventAuthentication , "WARNING: Azure Arc doesn't support user-assigned managed identities" )
413413 if id .idKind () == miResourceID {
414- q .Add (qpResID , id .String ())
414+ q .Add (miResID , id .String ())
415415 } else {
416416 q .Add (qpClientID , id .String ())
417417 }
@@ -437,7 +437,7 @@ func (c *managedIdentityClient) createCloudShellAuthRequest(ctx context.Context,
437437 log .Write (EventAuthentication , "WARNING: Cloud Shell doesn't support user-assigned managed identities" )
438438 q := request .Raw ().URL .Query ()
439439 if id .idKind () == miResourceID {
440- q .Add (qpResID , id .String ())
440+ q .Add (miResID , id .String ())
441441 } else {
442442 q .Add (qpClientID , id .String ())
443443 }
0 commit comments