Azure / azure-saas

The Azure SaaS Development Kit (ASDK) provides a reference architecture, deployable reference implementation and tools to help developers, startups, ISVs and Enterprises deliver their applications as a SaaS service. A platform for platform creators.
https://aka.ms/azuresaasdevkit
326 stars 239 forks source link

unable to successfully complete run.sh for SaaS Permissions service API #226

Closed indemnityjames closed 1 year ago

indemnityjames commented 1 year ago

Describe the bug Following the instructions of the Identity Framework, I was able to complete a successful deployment.

Running ./setup.sh from src/Saas.Identity/Saas.Permissions/deployment completes successfully.

But when attempting to ./run.sh from the previous folder, I get an error:

SaaS Administration Service API

Provisioning the SaaS Administration Service API... The file /asdk/src/Saas.Identity/Saas.Permissions/deployment/bicep/parameters/app-service-parameters.json does not exist, creating it now cp: cannot stat '/asdk/src/Saas.Identity/Saas.Permissions/deployment/bicep/parameters/parameters-template.json': No such file or directory

I tried to manually create the directory and copy the file over manually, but this did not work I also tried to run src/Saas.Lib/Deployment.Script.Modules/deploy-app-service.sh manually but I must need the wrapper scripts first as I got the error ./deploy-app-service.sh: line 8: ASDK_DEPLOYMENT_SCRIPT_PROJECT_BASE: unbound variable

Screenshot 2023-05-28 165930

1iveowl commented 1 year ago

Hi @indemnityjames. Did you just fork the repo recently? If not, please try and sync your repo to get the latest version. There was a bug related to this that was fixed a few weeks ago.

The error you are getting is that the file .../parameters-template.json is missing or that the path is wrong. This file is part of the repo.

You may want to take a look at this discussion #217

Let me know if this helps?

Thanks

indemnityjames commented 1 year ago

Hi @1iveowl thanks for coming back to me. I had forked recently and I went back to check I am in sync: This branch is not behind the upstream Azure:main No new commits to fetch. Enjoy your day!

I did an update: sudo apt update && sudo apt upgrade

I blew away the clone on the WSL 2.0 Ubuntu and recloned it I coped the config.json into the Identity folder to remove that first error

then I reran ./run.sh in the SaaS.Permissions/deployment folder again, but still get the same error:

SaaS Administration Service API

  Provisioning the SaaS Administration Service API...
  The file /asdk/src/Saas.Identity/Saas.Permissions/deployment/bicep/parameters/app-service-parameters.json does not exist, creating it now
  cp: cannot stat '/asdk/src/Saas.Identity/Saas.Permissions/deployment/bicep/parameters/parameters-template.json': No such file or directory
1iveowl commented 1 year ago

Thank you.

I found the issue. In our repo we've renamed the folder .\bicep\Parameters to .\bicep\parameters lowercase, but for some reason Git have not picked up on this change. Will make an update asap that gets reflected by the repo.

1iveowl commented 1 year ago

Should be fixed with commit d020e20 and ebcb2be

1iveowl commented 1 year ago

@indemnityjames please confirm that you can make it work now?

indemnityjames commented 1 year ago

thanks @1iveowl I have

image

1iveowl commented 1 year ago

You write that you are publishing to a new subscription, right?

I wonder if it's using the old config.json file referencing a non existing resource group for this new subscription.

Can you look for a resource group with 88su in it in your subscription?

indemnityjames commented 1 year ago

that RG exists in Azure, I did delete the old config.json before running SaaS.IdentityProvider again image

1iveowl commented 1 year ago

I tried to run the script from WSL with the latest changes and I'm unable to reproduce the issue you outline.

I started with a whole new deployment. The Identity Provider script runs first and then I deploy Saas.Permissions with that script and this works too.

Do you have more logs or could you try and delete everything and try again from the very beginning?

indemnityjames commented 1 year ago

thanks @1iveowl I have completed a successful deployment now Permissions app was looking for a Sub that I had deleted - when I ran az login --scope "https://graph.microsoft.com/.default" I could see that two Subs were discovered - the Sub I deleted and the one I had deployed Identity into Anyway I waited until the Sub was removed from the Portal, reran the az login and found only one Sub discovered, re-ran the script and all was good.

Thanks for your help

1iveowl commented 1 year ago

Awesome. Thanks for lette us know 👍