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
332 stars 286 forks source link

Setup Identity Framework - Docker B2C tenant creation Error Not Found Resource with ID #199

Closed basztech closed 2 years ago

basztech commented 2 years ago

Hi,

Following the quick start guide using Docker fails early in the script on setting up the identity framework. It looks like the script is trying to validate against the wrong path. Is there a work around or do I ned to forget using Docker?

Error message....

Waiting for 30 seconds for B2C tenant creation...
ERROR: (NotFound) Resource with ID '*********************01/saas-identity/bastechllc.onmicrosoft.com' does not exist.
Code: NotFound
Message: Resource with ID '*********************01/saas-identity/bastechllc.onmicrosoft.com' does not exist.
Target: resource

My Azure resource group that was created by the script...

{
    "id": "/subscriptions/*********************01/resourceGroups/saas-identity",
    "name": "saas-identity",
    "location": "eastus",
    "properties": {
        "provisioningState": "Succeeded"
    }
}
landonpierce commented 2 years ago

@basztech Thanks for reporting the issue. Can you confirm (through the portal) if the B2C tenant is actually getting created within that resource group?

basztech commented 2 years ago

No resources have been created in that resource group.

landonpierce commented 2 years ago

Hmm, it looks like that tenant name has been taken. Does it exist maybe in another resource group or subscription? Or did you create it at one point and then delete it? B2C tenants are notoriously difficult to delete once they've been created :).

Can you try picking a different name to double check this theory? We're working on adding a check to the script to warn you beforehand, but in the meantime, you can check the name in the Azure portal first.

image

basztech commented 2 years ago

But I do own that tenant. Ah, looking at the Azure doco, it makes a bit more sense since we are creating an additional active directory and need an additional tenant, not the existing one.

I tried a new tenant name and it works just like you said, until...

Consent granted
Creating App Registration asdk-saas-app
Add-MgApplicationPassword_AddExpanded: /app/Saas.IdentityProvider/scripts/B2C-Create.ps1:628
Line |
 628 |        $newAppSecretObject = Add-MgApplicationPassword -ApplicationId  …
     |        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Resource '4f519cb4-0da0-497d-a8f8-1a9bc897c9d2' does not exist or one of its queried reference-property objects are not present.

A second run with the same parameters and not removing anything already created has gone past this stage, so all good for now.

Thanks for your help.

basztech commented 2 years ago

So this was not an issue with the code but with my understanding of the implmentation.