Skip to content
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

Correct application ID format in appendResource #1904

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

max-blue
Copy link

@max-blue max-blue commented Aug 7, 2024

fixes issue #1902

fix(azuread): Correct application ID format in appendResource

Prepend "/applications/" to the application ID in the appendResource function to match the expected format of "/applications/{applicationId}". This resolves the parsing error during resource import for Azure AD applications.

Copy link

google-cla bot commented Aug 7, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@anthony-pastor
Copy link

Thanks @max-blue
Same thing for other resources:

--- a/providers/azuread/user.go
+++ b/providers/azuread/user.go
@@ -38,7 +38,8 @@ func (az *UserServiceGenerator) listResources() ([]msgraph.User, error) {
 func (az *UserServiceGenerator) appendResource(resource *msgraph.User) {
 	id := resource.ID
-	az.appendSimpleResource(*id, *resource.DisplayName, "azuread_user")
+	fullID := "/users/" + *id
+	az.appendSimpleResource(fullID, *resource.DisplayName, "azuread_user")
 }
--- a/providers/azuread/group.go
+++ b/providers/azuread/group.go
@@ -38,7 +38,8 @@ func (az *GroupServiceGenerator) listResources() ([]msgraph.Group, error) {
 
 func (az *GroupServiceGenerator) appendResource(resource *msgraph.Group) {
 	id := resource.ID
-	az.appendSimpleResource(*id, *resource.DisplayName+"-"+*id, "azuread_group")
+	fullID := "/groups/" + *id
+	az.appendSimpleResource(fullID, *resource.DisplayName+"-"+*id, "azuread_group")
 }

...

@github-actions github-actions bot added the Stale label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants