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

Unable to execute pipeline #31

Open ChallaSailendra opened 1 year ago

ChallaSailendra commented 1 year ago

We are trying to build GMM as per your blog ,while at the execution of pipeline we are getting some errors.Please find below the error messages:-

[error]Error: The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1

[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\2.0.2210.2\Service\GroupMembershipManagement\Hosts\JobTrigger\Services.Tests

[warning]RetryHelper encountered task failure, will retry (attempt #: 2 out of 3) after 4000 ms

Pipleline log.pdf

Pipleline log.pdf

danielluo-msft commented 1 year ago

Hi @ChallaSailendra ,

We are working on pushing out a new update to our public repo soon that would resolve this issue. But in the meantime, to fix this issue: "The total line coverage is below the specific 93" Update that value for JobTrigger coverageThreshold within your vsts-cicd.yml file from 93 to 89:

ChallaSailendra commented 1 year ago

Hi Daniello,

Still we are facing the same issue ,attaching the logs for your reference logs_46.zip logs_46.zip

ChallaSailendra commented 1 year ago

Hi @danielluo-msft,

We run the pipeline, below is the screenshot of the pipeline results. Can you help why last 2 activities in pipeline skipped. pipeline

And also help me output of the pipeline if pipeline succeeded.

ChallaSailendra commented 1 year ago

Hi @danielluo-msft,

We run the pipeline, below is the screenshot of the pipeline results. Can you help why last 2 activities in pipeline skipped. pipeline and And also help me output of the pipeline if pipeline succeeded.

Attaching the logs for your reference. logs_46.zip

pipeline

ChallaSailendra commented 1 year ago

Hi @danielluo-msft,

We run the pipeline, below is the screenshot of the pipeline results. Can you help why last 2 activities in pipeline skipped. pipeline and And also help me output of the pipeline if pipeline succeeded.

Attaching the logs for your reference. pipeline logs_46.zip

ChallaSailendra commented 1 year ago

Looking for some help for the above errors.

alrios-ms commented 1 year ago

Hi @ChallaSailendra,

Looking at the logs the issue seems to be similar as the one described by @danielluo-msft for the code coverage.

You might need to update the value of coverageThreshold within your vsts-cicd.yml file for your functions. Based on the numbers from your logs, I will suggest these:

GraphUpdater - 70 SecurityGroup - 80 JobScheduler - 40

Regarding AzureTableBackup the error message is "Project file(s) matching the specified pattern were not found." It seems there might be files missing for this function in your directory.

FYI: AzureTableBackup function has been renamed to AzureMaintenance in the latest version.

ChallaSailendra commented 1 year ago

Hi Alrios,

Thank you for your response, As you suggested made the changes and execute the pipeline. Successfully moved forwarded now we are seeing different error .

Sharing the logs.

logs_54.zip gmm_Error

ChallaSailendra commented 1 year ago

Hi Alrios,

We renamed AzureTableBackup with AzureMaintenance and update the value as suggested and rerun the pipeline . Expect NonProd_int all other jobs are executed successfully .Could you please help me sharing the logs for your reference GMM_Nonprod

logs_55.zip

ChallaSailendra commented 1 year ago

Hi Team,

Looking for your support hand on the issue

alrios-ms commented 1 year ago

Hi @ChallaSailendra ,

I see you renamed the AzureTableBackup function, my intention was just to let you know the function has been renamed in the latest version, manually renaming it is not necessary. I am sorry for the confusion.

Based on the screenshot and the logs provided, I noticed a couple of things:

You are using the "int" environment for this deployment based off of your main branch, note that the deployment condition for "int" expects the branch to be "develop". You would need to update the condition to replace "develop" or add "main", similar to UA.

INT eq(variables['Build.SourceBranch'], 'refs/heads/develop')

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

The other thing, you are using the default names "gmm" and "int", which might cause name collisions.

"We recommend trying to use unique and names, since some resources in Azure require to have unique names globally so it is possible to have name collisions."

ChallaSailendra commented 1 year ago

Hi Alrios ,

Thank you for your help..we made the changes and executed them again, but still we see some error messages hope you can help us to resolve it . Attach the logs and screenshots.

logs_58.zip Capture

ChallaSailendra commented 1 year ago

HI Team,

Any suggestions for the above errors

danielluo-msft commented 1 year ago

Hi @ChallaSailendra,

It looks like there is an issue with the deployment on the Azure side so there isn't enough details in the DevOps side to be able to determine the cause. Can you go to your resource group for GMM (start with the data resource group) and take a look at the "Deployments" blade on the left side for that resource group? That should provide more details on the issue so you can know what failed in the deployment.

image

ChallaSailendra commented 1 year ago

gmmsnip Hi Danielluo,

Thanks for you reponse,Verified in deployment tab "{"code":"DeploymentFailed","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.","details":[{"code":"VaultNotFound","message":"The specified vault 'gmm-data-int' could not be found. This error can happen if the vault was placed in a recoverable state by deleting the vault. Ensure that either the vault was successfully created or that it is not in a recoverable state. To view the vaults in recoverable state you can follow this link https://go.microsoft.com/fwlink/?linkid=2149745 and recover the vault."}]}"

ChallaSailendra commented 1 year ago

Hi Team,

Waiting for your support.

alrios-ms commented 1 year ago

Hi @ChallaSailendra,

Most likely the keyvault was not created, as I mentioned earlier, the default environment names 'int', 'ua', 'prodv2' must not be reused since some resources like KeyVaults have global unique names, if another person is already using gmm-data-int, no one else would be able to reuse that name.

See GMM Environments for more information.

ChallaSailendra commented 1 year ago

HI Team,

Thank you for all your support, we are able to deploy all the configurations in the environment. When we onboarded a schedule job ,getting below error message in the logs. Caught unexpected exception in Part# 2, marking sync job as errored. Exception: System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized). at Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableOrchestrationContext.CallDurableTaskFunctionAsync[TResult](String functionName, FunctionType functionType, Boolean oneWay, String instanceId, String operation, RetryOptions retryOptions, Object input, Nullable`1 scheduledTimeUtc) in D:\a_work\1\s\src\WebJobs.Extensions.DurableTask\ContextImplementations\DurableOrchestrationContext.cs:line 739 at Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableOrchestrationContext.ScheduleDurableHttpActivityAsync(DurableHttpRequest req) in D:\a_work\1\s\src\WebJobs.Extensions.DurableTask\ContextImplementations\DurableOrchestrationContext.cs:line 308 at Microsoft.Azure.WebJobs.Extensions.DurableTask.DurableOrchestrationContext.Microsoft.Azure.WebJobs.Extensions.DurableTask.IDurableOrchestrationContext.CallHttpAsync(DurableHttpRequest req) in D:\a_work\1\s\src\WebJobs.Extensions.DurableTask\ContextImplementations\DurableOrchestrationContext.cs:line 271 at Hosts.SecurityGroup.OrchestratorFunction.RunOrchestratorAsync(IDurableOrchestrationContext context) in D:\a\1\2.0.2301.2\Service\GroupMembershipManagement\Hosts\SecurityGroup\Function\Orchestrator\OrchestratorFunction.cs:line 122 location_s SecurityGroup DryRun_s False slot_s Production event_s RunOrchestratorAsync operation_s OrchestratorFunction Type ApplicationLog_CL

alrios-ms commented 1 year ago

Hi @ChallaSailendra

Based on your logs, SecurityGroup function is failing when calling MembershipAggregator function, it is getting a 401 (Unauthorized) code, for context when SecurityGroup calls the MembershipAggregator function, a function key must be passed as part of the url in order to authorize that call. Please verify that the function key that SecurityGroup is using is correct following this steps.

  1. Go to your MembershipAggregator function
  2. This is the MembershipAggregator function key, we need to verify that the default function key is the one being used by the SecurityGroup function. image
  3. Go to your SecurityGroup function
  4. In the Configuration section, edit this setting "membershipAggregatorFunctionKey" it will have a value similar to this one @Microsoft.KeyVault(SecretUri=https://gmm-data-test.vault.azure.net/secrets/membershipAggregatorFunctionKey/a321a335210b4c98976b05bf7d2775c0) The last section of the value indicates the version of the secret that is being used, in this case it is: "a321a335210b4c98976b05bf7d2775c0"

image

  1. Now we need to verify the actual value of that secret in your data keyvault. Open your <gmm>-data-<env> keyvault and navigate to Secrets image Open your "membershipAggregatorFunctionKey" secret, you might see different versions, something like this. image Locate the version that SecurityGroup is using (from Step 4) and show the secret value. The value displayed here must match that one from Step 2 in order to work. image

If they don't match, try redeploying your code that should update the function keys accordingly.

ChallaSailendra commented 1 year ago

Hi Team,

Thank you for the help, We verified and made changes as proposed. Now when we are executing the script "New-GmmSecurityGroupSyncJob" getting below errors . Please find the attachment of error message. ![Uploading Capture_Error.PNG…]()

Get-AzADGroup : Cannot process argument transformation on parameter 'ObjectId'. Cannot convert value "[{"type":"SecurityGroup"" to type "System.Guid". Error: "Expected {0xdddddddd, etc}." At line:120 char:79