microsoft / industry

This repository provides holistic architecture design and reference implementation for industry cloud based on proven success of large scale deployments and at-scale adoption with customers and partners.
MIT License
255 stars 72 forks source link

Power Platform Landing Zones deployment failure #424

Closed LocDaiLeFromTwoMany closed 1 year ago

LocDaiLeFromTwoMany commented 1 year ago

Steps to reproduce

Deploying Power Platform Landing zones PPLZ-setup RG

Error Message

Object reference not set to an instance of an object. (Code: DeploymentScriptOperationFailed)

Screenshots

image

Code of Conduct

krnese commented 1 year ago

@daltondhcp can you please have a look?

daltondhcp commented 1 year ago

@LocDaiLeFromTwoMany - I did some debugging in the backend it indicates that there are no Power Platform licenses in the tenant. Can you confirm that you have that?

LocDaiLeFromTwoMany commented 1 year ago

@LocDaiLeFromTwoMany - I did some debugging in the backend it indicates that there are no Power Platform licenses in the tenant. Can you confirm that you have that?

@daltondhcp - I'm not sure which licenses you are referencing to. My account has Power Apps pr. user plan. that is maybe not it?

image

daltondhcp commented 1 year ago

Apologies for the late reply. Per User plan should be sufficient as long as you have enough capacity. Are you able to create new environments manually in Power Platform Admin Center?

LocDaiLeFromTwoMany commented 1 year ago

Apologies for the late reply. Per User plan should be sufficient as long as you have enough capacity. Are you able to create new environments manually in Power Platform Admin Center?

@daltondhcp how much capcity is needed? Yes I can create environments manually.

image
daltondhcp commented 1 year ago

Perfect, that should absolutely be sufficient. Can you please share the log output in text format from the deployment script (couldn't see it all in the screenshot)

LocDaiLeFromTwoMany commented 1 year ago

Perfect, that should absolutely be sufficient. Can you please share the log output in text format from the deployment script (couldn't see it all in the screenshot)

Here is the raw error of the deployment.

{ "code": "DeploymentFailed", "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.", "details": [ { "code": "DeploymentScriptOperationFailed", "message": "Object reference not set to an instance of an object." } ] }

daltondhcp commented 1 year ago

Perfect, that should absolutely be sufficient. Can you please share the log output in text format from the deployment script (couldn't see it all in the screenshot)

Here is the raw error of the deployment.

{ "code": "DeploymentFailed", "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.", "details": [ { "code": "DeploymentScriptOperationFailed", "message": "Object reference not set to an instance of an object." } ] }

I was more referring to this output from the deploymentscript, including the script execution parameters image

LocDaiLeFromTwoMany commented 1 year ago

Perfect, that should absolutely be sufficient. Can you please share the log output in text format from the deployment script (couldn't see it all in the screenshot)

Here is the raw error of the deployment. { "code": "DeploymentFailed", "message": "At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.", "details": [ { "code": "DeploymentScriptOperationFailed", "message": "Object reference not set to an instance of an object." } ] }

I was more referring to this output from the deploymentscript, including the script execution parameters image

Sorry. Here it is.

-PPGuestMakerSetting yes -PPAppSharingSetting yes -PPEnvCreationSetting yes -PPTrialEnvCreationSetting yes -PPEnvCapacitySetting yes -PPTenantDLP high -PPTenantIsolationSetting none -PPTenantIsolationDomains '' -PPAdminEnvEnablement yes -PPAdminEnvNaming namconadminenv -PPAdminBilling yes -PPAdminRegion europe -PPAdminCoeSetting no -PPAdminDlp yes -PPAdminManagedEnv yes -PPDefaultRenameText Personal -PPDefaultDLP yes -PPDefaultManagedEnv yes -PPDefaultManagedSharing yes -PPCitizen yes -PPCitizenConfiguration null -PPCitizenCount 1 -PPCitizenNaming namconcitizendevenv -PPCitizenDescription desccitizendevenv -PPCitizenLanguage 1030 -PPCitizenCurrency dkk -PPCitizenRegion europe -PPCitizenDlp yes -PPCitizenManagedEnv yes -PPCitizenBilling yes -PPCitizenAlm yes -PPPro yes -PPProConfiguration null -PPProCount 1 -PPProNaming namconprodevenv -PPProDescription descprodevenv -PPProLanguage 1030 -PPProCurrency dkk -PPProRegion europe -PPProDlp yes -PPProManagedEnv yes -PPProBilling yes -PPProAlm yes -PPSelectIndustry none -PPIndustryNaming namconindustryenv -PPIndustryRegion europe -PPIndustryManagedEnv yes -PPIndustryAlm yes -PPIndustryBilling yes

daltondhcp commented 1 year ago

Did you get any additional insights/output below the parameters?

I have tested the same deployment with above parameters in my test environment successfully. Would you mind retry the deployment to ensure it wasn't a temporary issue.

LocDaiLeFromTwoMany commented 1 year ago

Did you get any additional insights/output below the parameters?

I have tested the same deployment with above parameters in my test environment successfully. Would you mind retry the deployment to ensure it wasn't a temporary issue.

Still the same outcome

image

LocDaiLeFromTwoMany commented 1 year ago

image image image image

daltondhcp commented 1 year ago

Can you also confirm that the User Managed Identity are added as an admin application (as per prereq https://github.com/microsoft/industry/tree/main/foundations/powerPlatform/referenceImplementation#pre-requisites)? Also, if you scroll through the console output, can you verify if there's more info there than what you shared with the screenshot? (if you can scroll down)

MarvinBangert commented 1 year ago

Hi @daltondhcp, I face the same issue as @LocDaiLeFromTwoMany, running the PowerShell locally with the same inputs works fine, the User Managed Identity is registered as described by the article: image

Within the Deployment Script I can see the following message inside the logs:

Executing script: .\nsPowerPlatform.ps1 -PPGuestMakerSetting yes -PPAppSharingSetting yes -PPEnvCreationSetting yes -PPTrialEnvCreationSetting yes -PPEnvCapacitySetting yes -PPTenantDLP low -PPTenantIsolationSetting both -PPTenantIsolationDomains '' -PPAdminEnvEnablement yes -PPAdminEnvNaming Admin -PPAdminBilling no -PPAdminRegion europe -PPAdminCoeSetting no -PPAdminDlp yes -PPAdminManagedEnv yes -PPDefaultRenameText Personal -PPDefaultDLP yes -PPDefaultManagedEnv yes -PPDefaultManagedSharing yes -PPCitizen yes -PPCitizenConfiguration null -PPCitizenCount 1 -PPCitizenNaming LowDev -PPCitizenDescription '' -PPCitizenLanguage 1033 -PPCitizenCurrency eur -PPCitizenRegion europe -PPCitizenDlp yes -PPCitizenManagedEnv yes -PPCitizenBilling no -PPCitizenAlm no -PPPro yes -PPProConfiguration null -PPProCount 1 -PPProNaming ProDev -PPProDescription '' -PPProLanguage 1033 -PPProCurrency eur -PPProRegion europe -PPProDlp yes -PPProManagedEnv yes -PPProBilling no -PPProAlm no -PPSelectIndustry none -PPIndustryNaming '' -PPIndustryRegion unitedstates -PPIndustryManagedEnv no -PPIndustryAlm no -PPIndustryBilling ''
WARNING: Resulting JSON is truncated as serialization has exceeded the set depth of 2.
daltondhcp commented 1 year ago

I have now been able to reproduce the issue in my environment with certain settings. Will work on creating a fix.

LocDaiLeFromTwoMany commented 1 year ago

I have now been able to reproduce the issue in my environment with certain settings. Will work on creating a fix.

Do you have an ETA for the fix?

daltondhcp commented 1 year ago

We have nailed it down to issues/changes with deploymentScripts execution (as earlier identified), yet to find a solution. As a workaround, you can execute the script manually with the same parameters as mentioned earlier in the thread.

vrugelda commented 1 year ago

Any update on fix for the issue? Same problem from my tests.

daltondhcp commented 1 year ago

Sorry for the delayed response. This should now be resolved, please verify and let us know if there are still any issues. The issue was an Az.Accounts module dependency in the DeploymentScripts execution environment.