@@ -11,9 +11,9 @@ import (
11
11
12
12
"github.com/hashicorp/go-azure-helpers/lang/pointer"
13
13
"github.com/hashicorp/go-azure-helpers/lang/response"
14
- "github.com/hashicorp/go-azure-sdk/microsoft-graph/applications/stable /application"
15
- "github.com/hashicorp/go-azure-sdk/microsoft-graph/applications/stable /federatedidentitycredential"
16
- "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/stable "
14
+ "github.com/hashicorp/go-azure-sdk/microsoft-graph/applications/beta /application"
15
+ "github.com/hashicorp/go-azure-sdk/microsoft-graph/applications/beta /federatedidentitycredential"
16
+ "github.com/hashicorp/go-azure-sdk/microsoft-graph/common-types/beta "
17
17
"github.com/hashicorp/go-azure-sdk/sdk/nullable"
18
18
"github.com/hashicorp/terraform-provider-azuread/internal/clients"
19
19
"github.com/hashicorp/terraform-provider-azuread/internal/helpers/consistency"
@@ -48,7 +48,7 @@ func applicationFederatedIdentityCredentialResource() *pluginsdk.Resource {
48
48
Type : pluginsdk .TypeString ,
49
49
Required : true ,
50
50
ForceNew : true ,
51
- ValidateFunc : stable .ValidateApplicationID ,
51
+ ValidateFunc : beta .ValidateApplicationID ,
52
52
},
53
53
54
54
"audiences" : {
@@ -99,10 +99,10 @@ func applicationFederatedIdentityCredentialResource() *pluginsdk.Resource {
99
99
}
100
100
101
101
func applicationFederatedIdentityCredentialResourceCreate (ctx context.Context , d * pluginsdk.ResourceData , meta interface {}) pluginsdk.Diagnostics { //nolint
102
- client := meta .(* clients.Client ).Applications .ApplicationClient
102
+ client := meta .(* clients.Client ).Applications .ApplicationClientBeta
103
103
federatedIdentityCredentialClient := meta .(* clients.Client ).Applications .ApplicationFederatedIdentityCredential
104
104
105
- applicationId , err := stable .ParseApplicationID (d .Get ("application_id" ).(string ))
105
+ applicationId , err := beta .ParseApplicationID (d .Get ("application_id" ).(string ))
106
106
if err != nil {
107
107
return tf .ErrorDiagPathF (err , "application_id" , "Parsing `application_id`" )
108
108
}
@@ -120,12 +120,12 @@ func applicationFederatedIdentityCredentialResourceCreate(ctx context.Context, d
120
120
return tf .ErrorDiagF (errors .New ("model was nil" ), "retrieving %s" , applicationId )
121
121
}
122
122
123
- credential := stable .FederatedIdentityCredential {
123
+ credential := beta .FederatedIdentityCredential {
124
124
Audiences : tf .ExpandStringSlice (d .Get ("audiences" ).([]interface {})),
125
125
Description : nullable .Value (d .Get ("description" ).(string )),
126
126
Issuer : d .Get ("issuer" ).(string ),
127
127
Name : d .Get ("display_name" ).(string ),
128
- Subject : d .Get ("subject" ).(string ),
128
+ Subject : nullable . Value ( d .Get ("subject" ).(string ) ),
129
129
}
130
130
131
131
federatedIdentityCredentialResp , err := federatedIdentityCredentialClient .CreateFederatedIdentityCredential (ctx , * applicationId , credential , federatedidentitycredential .DefaultCreateFederatedIdentityCredentialOperationOptions ())
@@ -141,7 +141,7 @@ func applicationFederatedIdentityCredentialResourceCreate(ctx context.Context, d
141
141
return tf .ErrorDiagF (errors .New ("nil or empty ID received" ), "API error adding federated identity credential for %s" , applicationId )
142
142
}
143
143
144
- id := stable .NewApplicationIdFederatedIdentityCredentialID (applicationId .ApplicationId , * newCredential .Id )
144
+ id := beta .NewApplicationIdFederatedIdentityCredentialID (applicationId .ApplicationId , * newCredential .Id )
145
145
146
146
// Wait for the credential to replicate
147
147
timeout , _ := ctx .Deadline ()
@@ -192,18 +192,18 @@ func applicationFederatedIdentityCredentialResourceUpdate(ctx context.Context, d
192
192
tf .LockByName (applicationResourceName , id .ObjectId )
193
193
defer tf .UnlockByName (applicationResourceName , id .ObjectId )
194
194
195
- credential := stable .FederatedIdentityCredential {
195
+ credential := beta .FederatedIdentityCredential {
196
196
Id : pointer .To (id .KeyId ),
197
197
Audiences : tf .ExpandStringSlice (d .Get ("audiences" ).([]interface {})),
198
198
Description : nullable .Value (d .Get ("description" ).(string )),
199
199
Issuer : d .Get ("issuer" ).(string ),
200
- Subject : d .Get ("subject" ).(string ),
200
+ Subject : nullable . Value ( d .Get ("subject" ).(string ) ),
201
201
202
202
// Name is immutable but must be specified as it is a required field
203
203
Name : d .Get ("display_name" ).(string ),
204
204
}
205
205
206
- credentialId := stable .NewApplicationIdFederatedIdentityCredentialID (id .ObjectId , id .KeyId )
206
+ credentialId := beta .NewApplicationIdFederatedIdentityCredentialID (id .ObjectId , id .KeyId )
207
207
208
208
if _ , err = federatedIdentityCredentialClient .UpdateFederatedIdentityCredential (ctx , credentialId , credential , federatedidentitycredential .DefaultUpdateFederatedIdentityCredentialOperationOptions ()); err != nil {
209
209
return tf .ErrorDiagF (err , "Updating federated identity credential with ID %q for application with object ID %q" , id .KeyId , id .ObjectId )
@@ -220,8 +220,8 @@ func applicationFederatedIdentityCredentialResourceRead(ctx context.Context, d *
220
220
return tf .ErrorDiagPathF (err , "id" , "Parsing federated identity credential with ID %q" , d .Id ())
221
221
}
222
222
223
- applicationId := stable .NewApplicationID (id .ObjectId )
224
- credentialId := stable .NewApplicationIdFederatedIdentityCredentialID (id .ObjectId , id .KeyId )
223
+ applicationId := beta .NewApplicationID (id .ObjectId )
224
+ credentialId := beta .NewApplicationIdFederatedIdentityCredentialID (id .ObjectId , id .KeyId )
225
225
226
226
resp , err := federatedIdentityCredentialClient .GetFederatedIdentityCredential (ctx , credentialId , federatedidentitycredential .DefaultGetFederatedIdentityCredentialOperationOptions ())
227
227
if err != nil {
@@ -258,7 +258,7 @@ func applicationFederatedIdentityCredentialResourceDelete(ctx context.Context, d
258
258
return tf .ErrorDiagPathF (err , "id" , "Parsing federated identity credential with ID %q" , d .Id ())
259
259
}
260
260
261
- credentialId := stable .NewApplicationIdFederatedIdentityCredentialID (id .ObjectId , id .KeyId )
261
+ credentialId := beta .NewApplicationIdFederatedIdentityCredentialID (id .ObjectId , id .KeyId )
262
262
263
263
tf .LockByName (applicationResourceName , id .ObjectId )
264
264
defer tf .UnlockByName (applicationResourceName , id .ObjectId )
0 commit comments