microsoftgraph / group-membership-management

Group Membership Management (GMM) is a service that dynamically manages the membership of AAD Groups. Groups managed by GMM can have their membership defined using existing AAD Groups and/or custom membership sources.
Other
49 stars 10 forks source link

unclear steps in documentation on "Configure Azure Devops" #22

Closed dborchers-gc closed 1 year ago

dborchers-gc commented 1 year ago

In the documentation i struggle on some points.

  1. on "create repositories https://github.com/microsoftgraph/group-membership-management#create-repositories i should create a repo "public"? when i manually import the repo its called group-membership-management. Can i stay with this name?
  2. In the private repo i should change the / with my projectname and repo name (the repo name of private right?)

what is with the other points in the vsts-cicd.yml? my shows like this image is the repository value correct because my main repo is called group-membership-management and not public? and what about the template links inside this file? everyone is called like build-services.yml@group-membership-management so it depends to the main repo or do i have to change it to @private

  1. on Create ADO environment https://github.com/microsoftgraph/group-membership-management#create-an-ado-environment there is the point iii "Fill in 'Name' which must follow this naming convention -" witzh no naming convention

  2. on Create pipeline https://github.com/microsoftgraph/group-membership-management#create-a-pipeline do i have to create a piepline fpr private repo or the public repo?

When i do that for private and try to run i got this error image

Maybe there are some missed points in the documentation and you can help

alrios-ms commented 1 year ago

@dborchers-gc Thank you for reaching out.

  1. Yes, you can stay with that name, so in Azure DevOps your 'public' repo name is 'group-membership-management'.

  2. This should be your <project-name>/<public-repo-name> repositories:

    • repository: group-membership-management -> this is an alias given to this repository within the yaml context so we can reference it in later tasks. You could use a different value if you like .i.e. gmm-repo, but you will need to replace references to @group-membership-management in the yaml file. type: git name: <project-name>/<public-repo-name> ref: main
  3. You are right, seems there is an issue with the MD file formatting in the preview, but the raw file has the correct information. Fill in 'Name' which must follow this naming convention <SolutionAbbreviation>-<EnvironmentAbbreviation> https://raw.githubusercontent.com/microsoftgraph/group-membership-management/main/README.md

  4. You need to create the pipeline for the private repo.

I think the error you are getting is because of the repository you are using group-membership-management/private, it should be <project-name>/<public-repo-name>.

dborchers-gc commented 1 year ago

Okay great thanks @alrios-ms but now i struggle at this point image

Maybe you have an idea how to fix that?

alrios-ms commented 1 year ago

@dborchers-gc

The issue seems to be the code coverage threshold, if it falls below the specified value the build will fail. Based on the error message the minimum expected code coverage is 93, but the build is reporting 89.17%.

Could you verify the threshold values specified in the vsts-cicd.yml file in your private repo match those specified in the vsts-cicd.yml from the public repo. I see the expected threshold is set to 89 in the file so this should build with no issues. I noticed the Private folder has actually the threshold set to 93, which seems to be out of date. We are planning to remove that folder in favor of this recently created new repository https://github.com/microsoftgraph/group-membership-management-tenant

https://github.com/microsoftgraph/group-membership-management/blob/7720e683b51f31b0a90dc3f4ec39b7098e3e3e08/vsts-cicd.yml#L30SS

image

dborchers-gc commented 1 year ago

thanks @alrios-ms for the quick response but i think that was not the reason, the threshod values at specially this was at 98 and i didnt change something at this points.

Hope it helps here are the full log pipeline-log.txt

And this is the content of the private vsts-cicd.yaml: vsts-yaml.txt

dborchers-gc commented 1 year ago

ok sorry i got it i had to decrease the value not to increase :D

Now that step works but i got another error image

alrios-ms commented 1 year ago

@dborchers-gc Could you verify your private repo folder structure? There should be a Scripts folder in there, if there is not you could add one even if it's empty, commit and push it, or the alternative would be to remove or comment out this task in the build-services.yml given that you might not have any Scripts to be published.

- task: CopyFiles@2
  displayName: 'Copy release management scripts'
  inputs:
    SourceFolder: Scripts
    TargetFolder: '$(build.artifactstagingdirectory)/Scripts'

image

dborchers-gc commented 1 year ago

Okay got it ;-) next one :D image

P.S.: in the docs you said that i should copy the content of teh private folder to the private repo and there is no Scripts subfolder, so maybe you can add that to the docs ;-)

alrios-ms commented 1 year ago

@dborchers-gc You are right, we have deprecated the 'Private' folder in favor of this repository https://github.com/microsoftgraph/group-membership-management-tenant, we still need to update the README to reflect this.

I see the task is failing since the required script has been removed, however that was not reflected in the Private folder, there are other old dependencies after this failing step, which means the next steps will fail too, at this point I highly recommend replacing the content of your Private repo with the content from this repo https://github.com/microsoftgraph/group-membership-management-tenant, the folder structure remains the same, so there should be minimal changes to do. i.e. update your repository name, environment name, paramemter..json files, pretty much the same changes you already made to your existing repo.

Also, we have added new functions some, are required for GMM to operate, which are not present in your current vsts-cicd.yml file. See updated file https://github.com/microsoftgraph/group-membership-management-tenant/blob/main/vsts-cicd.yml

Let me know if you run into any problems.

dborchers-gc commented 1 year ago

I´m really sorry i didnt understand the steps in the readme from https://github.com/microsoftgraph/group-membership-management-tenant :-(

I´ve just copied the content from this repo into my private repo but i guess thats not all i have to do.

I´m not really firm in devops and i only know the git basics, maybe i didnt understand whats easy for you :D

When i try this steps i have add the repo as subfolder in private and my public repo dont have the name publich to i just have to change that? image

dborchers-gc commented 1 year ago

Okay after editing the yaml file i´m a little bit further image

I had to change the 'environmentAbbreviation' on some points and there are 3 steps with 'template: yaml/deploy-pipeline.yml' i´ve removed the last 2 steps

but now the pipeline skips the last step i think thats not correct.

Here is the current content of the vsts-cicd.yml vsts-yaml.txt

alrios-ms commented 1 year ago

@dborchers-gc We will work to make those steps easier to follow and understand. Thanks for your feedback!

Based on your last screenshot looks like the name of your branch is 'main'. In your vsts-yaml.txt file you are using stage NonProd_int which is conditioned to run only for 'develop' branch.

Line: 107 eq(variables['Build.SourceBranch'], 'refs/heads/develop'),

Could you replace that with this:

in(variables['Build.SourceBranch'], 'refs/heads/master', 'refs/heads/main'),

notice this will run for the 'main' branch, in case you are using a different branch name they would need to match.

dborchers-gc commented 1 year ago

Okay, small steps but we come further 😉

Thats the next one: image

alrios-ms commented 1 year ago

@dborchers-gc I think your parameter file was copied over from https://github.com/microsoftgraph/group-membership-management/blob/main/Private/Infrastructure/data/parameters/parameters.env.json you would need to replace that with this one https://github.com/microsoftgraph/group-membership-management-tenant/blob/main/Infrastructure/data/parameters/parameters.int.json or manually apply the changes.

There are some differences between the two files:

serviceBusQueueName has been removed. - breaking change - emailReceivers has been added. - breaking change -

serviceBusTopicSubscriptions has been updated.
GMM:LearnMoreUrl has been updated.

dborchers-gc commented 1 year ago

OK keep your fingers crossed for me, it runs again 😁

dborchers-gc commented 1 year ago

Yay first time resources are coming to the resource groups 😁 hope this time it will be finishing. I report tomorrow. Thanks for your help @alrios-ms 🙏

alrios-ms commented 1 year ago

@dborchers-gc You are welcome!

dborchers-gc commented 1 year ago

next one image

dborchers-gc commented 1 year ago

maybe taht helps image

alrios-ms commented 1 year ago

@dborchers-gc

Looks like it was not able to find the parameter files for your environment name. In your vsts-yaml.txt you are using 'cug' as your environment name, you would need to create parameter files for any new environment other than those provided by default (int, ua, prod).

Each function that is being deployed needs parameter files matching your environment name, you can copy the parameter files that are located in their corresponding infrastructure data and compute folders in the public repository.

Taking GraphUpdater as example: From the data folder you could copy one of the existing parameter files i.e. parameters.int.json rename it to parameters.cug.json and move it to the corresponding folder in your private repository.

Same process for the compute parameter file.

You would need to do this for the other functions too

JobTrigger GraphUpdater SecurityGroup AzureTableBackup JobScheduler MembershipAggregator

dborchers-gc commented 1 year ago

Hmm okay done. Now only one Service seems to have problems but i´ve uploaded every parameter file

image

dborchers-gc commented 1 year ago

for example image

alrios-ms commented 1 year ago

Would you mind sharing the raw error it can be found in the Azure Portal in your compute resource group, similar to this.

image

dborchers-gc commented 1 year ago

here you are rawerror.txt

dborchers-gc commented 1 year ago

this might also be interesting: image

dborchers-gc commented 1 year ago

Oh maybe the reason is i missed these setp https://github.com/microsoftgraph/group-membership-management/blob/main/Service/GroupMembershipManagement/Repositories.Mail/Documentation/SetSenderAddressForEmailNotification.md

dborchers-gc commented 1 year ago

@alrios-ms i could finished the pipeline... yay :D

Thanks so much for your help. The problem was my missed step abouth the Email Notifications.

I would like to send an example for updating the Readme with our conversations and better explanations in it to thanks you with that. Hope it help for thers to complete the steps.

Now i found another problem and ive add another Issue for that. You find it under ID #23

alrios-ms commented 1 year ago

@dborchers-gc You are welcome! I am glad it worked out for you. I noticed you created a PR, we will take your changes and publish them, Thank you for that.

Regarding sending your README updates, is that something you would prefer doing by creating a PR or via email, whichever way you prefer works.

Regards.

dborchers-gc commented 1 year ago

@alrios-ms yes youre right my gmm is live 💪

Yes i noticed some unclear steps in the documentation i would like to fix after our journey 😉

And i have some questions about who the gmm really works but i will set up new issues for that and i hope you could get me some answers